Watto, the owner of a spare parts store, has recently got an order for the mechanism that can process strings in a certain way. Initially the memory of the mechanism is filled with n strings. Then the mechanism should be able to process queries of the following type: "Given string s, determine if the memory of the mechanism contains string t that consists of the same number of characters as s and differs from s in exactly one position".

Watto has already compiled the mechanism, all that's left is to write a program for it and check it on the data consisting of n initial lines and m queries. He decided to entrust this job to you.

Input

The first line contains two non-negative numbers n and m (0 ≤ n ≤ 3·105, 0 ≤ m ≤ 3·105) — the number of the initial strings and the number of queries, respectively.

Next follow n non-empty strings that are uploaded to the memory of the mechanism.

Next follow m non-empty strings that are the queries to the mechanism.

The total length of lines in the input doesn't exceed 6·105. Each line consists only of letters 'a', 'b', 'c'.

Output

For each query print on a single line "YES" (without the quotes), if the memory of the mechanism contains the required string, otherwise print "NO" (without the quotes).

Examples

Input

2 3
aaaaa
acacaca
aabaa
ccacacc
caaac


Output

YES
NO
NO
/**
 * DA-IICT
 * Author : PARTH PATEL
 */
import java.io.*;
import java.math.*;
import java.util.*;

import static java.util.Arrays.fill;
import static java.lang.Math.*;
import static java.util.Arrays.sort;
import static java.util.Collections.sort;


public class C514 {

	public static int mod = 1000000007;
	static FasterScanner in = new FasterScanner();
	static PrintWriter out = new PrintWriter(System.out);
	static long prime1=11;
	static long mod1=1110111110111L;
	static long prime2=31;
	static long mod2=10000009;
	static int maxn=(int) (6*1e5)+10;
	static long[] power1=new long[maxn];
	static long[] power2=new long[maxn];
	public static void precalculate()
	{
		power1[0]=1;
		power2[0]=1;
		for(int i=1;i<maxn;i++)
		{
			power1[i]=(power1[i-1]*prime1)%mod1;
			power2[i]=(power2[i-1]*prime2)%mod2;
		}
	}
	public static long hashcalculator(String s)
	{
		long[] prehash1=new long[s.length()+1];
		for(int i=1;i<=s.length();i++)
		{
			prehash1[i]=(prehash1[i-1]*prime1+(s.charAt(i-1)-'a'+1)%mod1)%mod1;
		}
		return prehash1[s.length()];
	}
	public static void main(String[] args) {

		int n=in.nextInt();
		int m=in.nextInt();
		long[] hasharray=new long[n];
		precalculate();
		for(int i=0;i<n;i++)
		{
			String s=in.nextLine();
			hasharray[i]=hashcalculator(s);
			//System.out.println(hasharray[i]);
		}
		Arrays.sort(hasharray);
		for(int i=0;i<m;i++)
		{
			String s=in.nextLine();
			long temphash=hashcalculator(s);
			boolean contains=false;
			for(int j=0;j<s.length();j++)
			{
				if(s.charAt(j)=='a')
				{
					long newtemphash1=(temphash-(('a'-'a'+1)*power1[s.length()-1-j])%mod1+(('b'-'a'+1)*power1[s.length()-1-j])%mod1+mod1)%mod1;
					long newtemphash2=(temphash-(('a'-'a'+1)*power1[s.length()-1-j])%mod1+(('c'-'a'+1)*power1[s.length()-1-j])%mod1+mod1)%mod1;
					//System.out.println(newtemphash1+" "+newtemphash2);
					int l=0;
					int r=n-1;
					while(l<=r)
					{
						int mid=(l+r)/2;
						if(hasharray[mid]==newtemphash1)
						{
							contains=true;
							break;
						}
						if(hasharray[mid]>newtemphash1)
						{
							r=mid-1;
						}
						else
						{
							l=mid+1;
						}
					}
					l=0;r=n-1;
					while(l<=r)
					{
						int mid=(l+r)/2;
						if(hasharray[mid]==newtemphash2)
						{
							contains=true;
							break;
						}
						if(hasharray[mid]>newtemphash2)
						{
							r=mid-1;
						}
						else
						{
							l=mid+1;
						}
					}
				}
				if(contains)
					break;
				if(s.charAt(j)=='b')
				{
					long newtemphash1=(temphash-(('b'-'a'+1)*power1[s.length()-1-j])%mod1+(('a'-'a'+1)*power1[s.length()-1-j])%mod1+mod1)%mod1;
					long newtemphash2=(temphash-(('b'-'a'+1)*power1[s.length()-1-j])%mod1+(('c'-'a'+1)*power1[s.length()-1-j])%mod1+mod1)%mod1;
					//System.out.println(newtemphash1+" "+newtemphash2);
					int l=0;
					int r=n-1;
					while(l<=r)
					{
						int mid=(l+r)/2;
						if(hasharray[mid]==newtemphash1)
						{
							contains=true;
							break;
						}
						if(hasharray[mid]>newtemphash1)
						{
							r=mid-1;
						}
						else
						{
							l=mid+1;
						}
					}
					l=0;r=n-1;
					while(l<=r)
					{
						int mid=(l+r)/2;
						if(hasharray[mid]==newtemphash2)
						{
							contains=true;
							break;
						}
						if(hasharray[mid]>newtemphash2)
						{
							r=mid-1;
						}
						else
						{
							l=mid+1;
						}
					}
				}
				if(contains)
					break;
				if(s.charAt(j)=='c')
				{
					long newtemphash1=(temphash-(('c'-'a'+1)*power1[s.length()-1-j])%mod1+(('a'-'a'+1)*power1[s.length()-1-j])%mod1+mod1)%mod1;
					long newtemphash2=(temphash-(('c'-'a'+1)*power1[s.length()-1-j])%mod1+(('b'-'a'+1)*power1[s.length()-1-j])%mod1+mod1)%mod1;
					
					//System.out.println(newtemphash1+" "+newtemphash2);
					int l=0;
					int r=n-1;
					while(l<=r)
					{
						int mid=(l+r)/2;
						if(hasharray[mid]==newtemphash1)
						{
							contains=true;
							break;
						}
						if(hasharray[mid]>newtemphash1)
						{
							r=mid-1;
						}
						else
						{
							l=mid+1;
						}
					}
					l=0;r=n-1;
					while(l<=r)
					{
						int mid=(l+r)/2;
						if(hasharray[mid]==newtemphash2)
						{
							contains=true;
							break;
						}
						if(hasharray[mid]>newtemphash2)
						{
							r=mid-1;
						}
						else
						{
							l=mid+1;
						}
					}
					if(contains)
						break;
				}
			}
			if(contains)
				out.println("YES");
			else
				out.println("NO");
		}
		out.close();

	}

	public static long pow(long x, long n, long mod) {
		long res = 1;
		for (long p = x; n > 0; n >>= 1, p = (p * p) % mod) {
			if ((n & 1) != 0) {
				res = (res * p % mod);
			}
		}
		return res;
	}

	public static long gcd(long n1, long n2) {
		long r;
		while (n2 != 0) {
			r = n1 % n2;
			n1 = n2;
			n2 = r;
		}
		return n1;
	}

	public static long lcm(long n1, long n2) {
		long answer = (n1 * n2) / (gcd(n1, n2));
		return answer;
	}

	static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int snumChars;

		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}

}
