{"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":"MD","content":"\u003cp\u003eManas has built his own web service. To get access to this web service one must login.\u003c/p\u003e\n\u003cp\u003eManas has 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, $$$s_1$$$ and $$$s_2$$$ (any of these strings can be empty); \u003c/li\u003e\n \u003cli\u003e the resulting hash $$$h \u003d s_1 + p\u0027 + s_2$$$, 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\"\u003e aabcaab\u003c/span\u003e\". Then $$$p\u0027$$$ can be equal to \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eabacaba\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\"\u003ezyxabacabakjh\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 Manas 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":"MD","content":"\u003cp\u003eThe first line contains one integer $$$t$$$ ($$$1 \\le t \\le 100$$$) — 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":"MD","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":"MD","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\naabcaab\nzyxabacabakjh\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":"MD","content":"\u003cp\u003eThe first test case is explained above.\u003c/p\u003e\n\u003cp\u003eIn the second test case both $$$s_1$$$ and $$$s_2$$$ 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 $$$s_1\u003d$$$ \"\u003cspan class\u003d\"tex-font-style-tt\"\u003en\u003c/span\u003e\", $$$s_2$$$ 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"}}]}