{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e \u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027]], displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027]]}\n });\n \u003c/script\u003e\n \u003cscript type\u003d\"text/javascript\" async\n src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\"\u003e\n \u003c/script\u003e\n\u003cp\u003eBenedict has built his own web service. Being a modern web service it includes login feature. And that always implies password security problems.\u003c/p\u003e\n\u003cp\u003eBenedict decided to store the hash of the password, generated by the following algorithm:\u003c/p\u003e\n\u003col\u003e \n \u003cli\u003e take the password p, consisting of lowercase Latin letters, and shuffle the letters randomly in it to obtain p\u0027 (p\u0027 can still be equal to p); \u003c/li\u003e\n \u003cli\u003e generate two random strings, consisting of lowercase Latin letters, s1 and s2 (any of these strings can be empty); \u003c/li\u003e\n \u003cli\u003e the resulting hash h \u003d s1 + p\u0027 + s2, where addition is string concatenation. \u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eFor example, let the password p \u003d\"\u003cspan class\u003d\"tex-font-style-tt\"\u003eabacaba\u003c/span\u003e\". Then p\u0027 can be equal to \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eaabcaab\u003c/span\u003e\". Random strings s1 \u003d\"\u003cspan class\u003d\"tex-font-style-tt\"\u003ezyx\u003c/span\u003e\" and s2 \u003d\"\u003cspan class\u003d\"tex-font-style-tt\"\u003ekjh\u003c/span\u003e\". Then h \u003d\"\u003cspan class\u003d\"tex-font-style-tt\"\u003ezyxaabcaabkjh\u003c/span\u003e\".\u003c/p\u003e\n\u003cp\u003eNote that no letters could be deleted or added to p to obtain p\u0027, only the order could be changed.\u003c/p\u003e\n\u003cp\u003eNow Benedict asks you to help him to implement the password check module. Given the password p and the hash h, check that h can be the hash for the password p.\u003c/p\u003e\n\u003cp\u003eYour program should answer t independent test cases.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains one integer t (1 \u003c\u003dt \u003c\u003d100) — the number of test cases.\u003c/p\u003e\n\u003cp\u003eThe first line of each test case contains a non-empty string p, consisting of lowercase Latin letters. The length of p does not exceed 100.\u003c/p\u003e\n\u003cp\u003eThe second line of each test case contains a non-empty string h, consisting of lowercase Latin letters. The length of h does not exceed 100.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case print the answer to it — \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\" if the given hash h could be obtained from the given password p or \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\" otherwise.\u003c/p\u003e"}},{"title":"Example","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e5\nabacaba\nzyxaabcaabkjh\nonetwothree\nthreetwoone\none\nzzonneyy\none\nnone\ntwenty\nten\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003eYES\nYES\nNO\nYES\nNO\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eThe first test case is explained in the statement.\u003c/p\u003e\n\u003cp\u003eIn the second test case both s1 and s2 are empty and p\u0027\u003d \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ethreetwoone\u003c/span\u003e\" is p shuffled.\u003c/p\u003e\n\u003cp\u003eIn the third test case the hash could not be obtained from the password.\u003c/p\u003e\n\u003cp\u003eIn the fourth test case s1\u003d\"\u003cspan class\u003d\"tex-font-style-tt\"\u003en\u003c/span\u003e\", s2 is empty and p\u0027\u003d \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eone\u003c/span\u003e\" is p shuffled (even thought it stayed the same). \u003c/p\u003e\n\u003cp\u003eIn the fifth test case the hash could not be obtained from the password.\u003c/p\u003e"}}]}