Hong has two strings S and T, he wants to know if S is a substring of T. If the given string S is a substring of T, print "YES", otherwise print "NO".
11471147
Hong has two strings S and T, he wants to know if S is a substring of T. If the given string S is a substring of T, print "YES", otherwise print "NO".
The first line will be an integer T (1≤T≤100), which is the number of test cases.
For each test data:
The first line contains two integers n and m (1≤n< m≤2⋅10^5) — the length of the string S and the length of the string T, respectively.
The second line contains string s of length n, which consists only of lowercase letters.
The third line contains string t of length m, which consists only of lowercase letters.
For each test cases, print "YES" (without quotes), if string S is a substring of T. Otherwise print "NO" (without quotes).
1
2 3
aa
aaa
YES