{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"题目描述","value":{"format":"MD","content":"有$n$个字符串,每个字符串仅由`a`,`b`,`c`三个字符构成。现在有$m$个询问,每个询问给一个字符串,问盒子里是否存在字符串满足以下条件:\n\n- 这个字符串的长度和询问的字符串长度相同\n- 这个字符串和询问的字符串仅有一个位置是不同的"}},{"title":"输入格式","value":{"format":"MD","content":"第一行有两个整数$n,m(0\\le n,m \\le 3\\times10^5)$。\n\n接下来$n+m$行,每行一个非空字符串,分别表示盒子里的字符串和询问的字符串。\n\n保证输入的总长度不超过$6\\times 10^5$,字符串仅有三种字符。"}},{"title":"输出格式","value":{"format":"MD","content":"对于每个询问,输出一行,回答`YES`或`NO`。"}},{"title":"样例输入","value":{"format":"MD","content":"```plaintext\n2 2\nccccc\ncbaaa\nacccc\ncbaaa\n```"}},{"title":"样例输出","value":{"format":"MD","content":"```plaintext\nYES\nNO\n```"}}]}