{"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":"Kim has made a new social media app, In it\u0027s login system he has integrated an password hashing system\nKim decided to store the hash of the password, generated by the following algorithm:\n\ntake 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);\ngenerate two random strings, consisting of lowercase Latin letters, s1 and s2 (any of these strings can be empty);\nthe resulting hash h\u003ds1+p\u0027+s2, where addition is string concatenation.\nFor example, let the password p\u003d \"abacaba\". Then p\u0027 can be equal to \"aabcaab\". Random strings s1\u003d \"zyx\" and s2\u003d \"kjh\". Then h\u003d \"zyxaabcaabkjh\".\nNote that no letters could be deleted or added to p to obtain p\u0027, only the order could be changed.\n\nNow Polycarp 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.\n\nYour program should answer t independent test cases."}},{"title":"Input","value":{"format":"HTML","content":"The first line contains one integer t (1\u003dt\u003d100) — the number of test cases.\n\nThe 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.\n\nThe 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.\n"}},{"title":"Output","value":{"format":"HTML","content":"For each test case print the answer to it — \"YES\" if the given hash h could be obtained from the given password p or \"NO\" otherwise.\n"}},{"title":"Example","value":{"format":"HTML","content":"5\nabacaba\n\nzyxaabcaabkjh\nonetwothree\nthreetwoone\none\nzzonneyy\none\nnone\ntwenty\nten"}},{"title":"","value":{"format":"HTML","content":"YES\nYES\nNO\nYES\nNO"}}]}