n = input().split() code_list = [input() for i in range(int(n[0]))] for j in code_list: if all(t in j for t in n[1]): print('Yes') else: print('No')