{"trustable":true,"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eAshish has two strings $$$a$$$ and $$$b$$$, each of length $$$n$$$, and an integer $$$k$$$. The strings only contain lowercase English letters.\u003c/p\u003e\u003cp\u003eHe wants to convert string $$$a$$$ into string $$$b$$$ by performing some (possibly zero) operations on $$$a$$$.\u003c/p\u003e\u003cp\u003eIn one move, he can either \u003c/p\u003e\u003cul\u003e \u003cli\u003e choose an index $$$i$$$ ($$$1 \\leq i\\leq n-1$$$) and swap $$$a_i$$$ and $$$a_{i+1}$$$, or \u003c/li\u003e\u003cli\u003e choose an index $$$i$$$ ($$$1 \\leq i \\leq n-k+1$$$) and if $$$a_i, a_{i+1}, \\ldots, a_{i+k-1}$$$ are \u003cspan class\u003d\"tex-font-style-bf\"\u003eall equal\u003c/span\u003e to some character $$$c$$$ ($$$c \\neq$$$ \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ez\u003c/span\u003e\u0027), replace each one with the next character $$$(c+1)$$$, that is, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\u0027 is replaced by \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eb\u003c/span\u003e\u0027, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eb\u003c/span\u003e\u0027 is replaced by \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ec\u003c/span\u003e\u0027 and so on. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eNote that he can perform any number of operations, and the operations can only be performed on string $$$a$$$. \u003c/p\u003e\u003cp\u003eHelp Ashish determine if it is possible to convert string $$$a$$$ into $$$b$$$ after performing some (possibly zero) operations on it.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a single integer $$$t$$$ ($$$1 \\leq t \\leq 10^5$$$)\u0026nbsp;— the number of test cases. The description of each test case is as follows.\u003c/p\u003e\u003cp\u003eThe first line of each test case contains two integers $$$n$$$ ($$$2 \\leq n \\leq 10^6$$$) and $$$k$$$ ($$$1 \\leq k \\leq n$$$).\u003c/p\u003e\u003cp\u003eThe second line of each test case contains the string $$$a$$$ of length $$$n$$$ consisting of lowercase English letters.\u003c/p\u003e\u003cp\u003eThe third line of each test case contains the string $$$b$$$ of length $$$n$$$ consisting of lowercase English letters.\u003c/p\u003e\u003cp\u003eIt is guaranteed that the sum of values $$$n$$$ among all test cases does not exceed $$$10^6$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYes\u003c/span\u003e\" if Ashish can convert $$$a$$$ into $$$b$$$ after some moves, else print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNo\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eYou may print the letters of the answer in any case (upper or lower).\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n3 3\nabc\nbcd\n4 2\nabba\nazza\n2 1\nzz\naa\n6 2\naaabba\nddddcc\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNo\nYes\nNo\nYes\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case it can be shown that it is impossible to convert $$$a$$$ into $$$b$$$.\u003c/p\u003e\u003cp\u003eIn the second test case,\u003c/p\u003e\u003cp\u003e\"\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003cspan class\u003d\"tex-font-style-bf\"\u003ebb\u003c/span\u003ea\u003c/span\u003e\" $$$\\xrightarrow{\\text{inc}}$$$ \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003cspan class\u003d\"tex-font-style-bf\"\u003ecc\u003c/span\u003ea\u003c/span\u003e\" $$$\\xrightarrow{\\text{inc}}$$$ $$$\\ldots$$$ $$$\\xrightarrow{\\text{inc}}$$$ \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eazza\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eHere \"swap\" denotes an operation of the first type, and \"inc\" denotes an operation of the second type.\u003c/p\u003e\u003cp\u003eIn the fourth test case,\u003c/p\u003e\u003cp\u003e\"\u003cspan class\u003d\"tex-font-style-tt\"\u003eaaab\u003cspan class\u003d\"tex-font-style-bf\"\u003eba\u003c/span\u003e\u003c/span\u003e\" $$$\\xrightarrow{\\text{swap}}$$$ \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eaaa\u003cspan class\u003d\"tex-font-style-bf\"\u003eba\u003c/span\u003eb\u003c/span\u003e\" $$$\\xrightarrow{\\text{swap}}$$$ \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e\u003cspan class\u003d\"tex-font-style-bf\"\u003eaa\u003c/span\u003eaabb\u003c/span\u003e\" $$$\\xrightarrow{\\text{inc}}$$$ $$$\\ldots$$$ $$$\\xrightarrow{\\text{inc}}$$$ \"\u003cspan class\u003d\"tex-font-style-tt\"\u003edd\u003cspan class\u003d\"tex-font-style-bf\"\u003eaa\u003c/span\u003ebb\u003c/span\u003e\" $$$\\xrightarrow{\\text{inc}}$$$ $$$\\ldots$$$ $$$\\xrightarrow{\\text{inc}}$$$ \"\u003cspan class\u003d\"tex-font-style-tt\"\u003edddd\u003cspan class\u003d\"tex-font-style-bf\"\u003ebb\u003c/span\u003e\u003c/span\u003e\" $$$\\xrightarrow{\\text{inc}}$$$ $$$\\ldots$$$ $$$\\xrightarrow{\\text{inc}}$$$ \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eddddcc\u003c/span\u003e\".\u003c/p\u003e"}}]}