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
import java.util.*;
import java.io.*;

public class Problem514C {

    static class Node {
        char val;
        boolean isEnd;
        Node[] children;
        HashSet<String> words;

        public Node(char v, boolean end) {
            val = v;
            isEnd = end;
            children = new Node[3];
            children[0] = null;
            children[1] = null;
            children[2] = null;
            words = new HashSet<String>();
        }

        public void addChild(Node n) {
            if (n.val == 'a') {
                children[0] = n;
            } else if (n.val == 'b') {
                children[1] = n;
            } else if (n.val == 'c') {
                children[2] = n;
            }
        }

        public Node findChild(char v) {
            if (v == 'a') {
                return children[0];
            } else if (v == 'b') {
                return children[1];
            } else if (v == 'c') {
                return children[2];
            }
            return null;
        }

        public void addWord(String s) {
            words.add(s);
        }

        public void printTree() {
            System.out.println(val + " " + isEnd + " " + words.size());
            for (Node n : children) {
                if (n != null) {
                    n.printTree();
                }
            }
        }
    }

    static class SearchNode {
        Node node;
        boolean switched;
        int length;

        public SearchNode(Node n, boolean s, int l) {
            node = n;
            switched = s;
            length = l;
        }
    }

    public static void main(String[] args) {
        //Scanner in = new Scanner(System.in);
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        try {
            String[] params = input.readLine().split(" ");
            int dictSize = Integer.parseInt(params[0]);
            int queries = Integer.parseInt(params[1]);
            Node root = new Node(' ', false);
            for (int idx = 0; idx < dictSize; idx++) {
                // populate dictionary word by word
                String curr = input.readLine();
                Node currNode = root;
                currNode.addWord(curr);
                for (int sdx = 0; sdx < curr.length(); sdx++) {
                    // get the node for this letter if exists
                    Node next = currNode.findChild(curr.charAt(sdx));
                    if (next == null) {
                        // if doesn't exist, make new node and add to trie
                        next = new Node(curr.charAt(sdx), false);
                        currNode.addChild(next);
                    }
                    // add word to hash set
                    //next.addWord(curr);
                    // set node as end if last in iteration
                    if (sdx == curr.length() - 1) {
                        next.isEnd = true;
                    }
                    // move to next node
                    currNode = next;
                }
            }
            // traverse dictionary to find word that works with one swap
            for (int idx = 0; idx < queries; idx++) {
                // get query
                String query = input.readLine();
                int length = query.length();
                // find all things in trie of correct length
                Queue<SearchNode> queue = new LinkedList<SearchNode>();
                queue.add(new SearchNode(root, false, 0));
                boolean found = false;
                StringBuilder newQuery = new StringBuilder(query);
                while (!queue.isEmpty() && !found) { // stop when queue is empty or we've found the one
                    SearchNode curr = queue.remove();
                    if (curr.length < length) {
                        for (int jdx = 0; jdx < 3; jdx++) {
                            Node node = curr.node.children[jdx];
                            SearchNode newNode = null;
                            if (node != null && ((node.val == query.charAt(curr.length)) || (!curr.switched))) {
                                // add word to queue untouched
                                newNode = new SearchNode(node, curr.switched || !(node.val == query.charAt(curr.length)), curr.length + 1);
                            }
                            // else don't continue down this path because >1 character needs to be swapped
                            // check if we switched
                            if (newNode != null && newNode.switched) {
                                newQuery.setCharAt(curr.length, newNode.node.val);
                                if (root.words.contains(newQuery.toString())) {
                                    found = true;
                                } else {
                                    newQuery.setCharAt(curr.length, query.charAt(curr.length));
                                }
                            } else if (newNode != null && newNode.length < length) {
                                queue.add(newNode);
                            }
                        }
                    }
                    // don't continue if we hit a word that is longer than query
                }
                if (found) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            }
        } catch(IOException e) {

        }
    }
}
