Given a set of banned words S, please find out whether it is possible to construct a string str1..∞ with infinite length that fulfills the following constrains:
- It consists of only the first M types of lowercase letters in the alphabet. For example M = 3, only 'a', 'b' and 'c' are allowed to appear in the string.
- There does not exist such (i, j) that stri..j is a banned word in S (1 <= i <= j < ∞).
- There does not exist such (i, j) that for any k >= i, strk = str(j + k) (1 <= i, j < ∞).
Input
There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:
The first line contains two integers N (1 <= N <= 100) and M (1 <= M <= 26). The following N lines, each line contains contains a non-empty string indicating a banned word in S. The length of each word will not exceed 1000 and the word only consists of lowercase letters.
Output
For each test case, output "Yes" if it is possible to construct such a string, otherwise "No".
Sample Input
22 2aabb1 2aa
Sample Output
NoYes
1 #include2 #include 3 #include 4 #include 5 using namespace std; 6 const int CHAR = 26; 7 const int TOT = 100005; 8 int next[TOT][CHAR], fail[TOT]; 9 bool virus[TOT]; 10 int L, root; 11 int m; 12 int newNode() { 13 for (int i=0; i