{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eSome contestants said on the Internet that they love Multi-University Training, did the rest of them have no keyboards?\u003cbr\u003e\u003cbr\u003eYou must be the one whose keyboard is badly broken. When you press a key, it triggers a random number of times.\u003cbr\u003e\u003cbr\u003eGiven a character $ch$ and an integer $k$, it means you press an alphanumeric key $ch$ only once, but it triggers $k$ times, and $k$ character $ch$ will be added to the end of the buffer.\u003cbr\u003e\u003cbr\u003eGiven a character \u0027-\u0027 and an integer $k$, it means you press the backspace key, it triggers $k$ times, delete $k$ characters from the end (If the number of characters is less than $k$, the buffer will be cleared).\u003cbr\u003e\u003cbr\u003eGiven the operations in chronological order, could you input your target text? Which means whether there is a time, your target text is a substring of your buffer characters? Answer \u0027yes\u0027 or \u0027no\u0027. (In formal language theory and computer science, a substring is a contiguous sequence of characters within a string.)\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"First line has one integer $T$, indicating there are $T$ test cases. In each case:\u003cbr\u003e\u003cbr\u003eFirst line has two integers $n, m$, $n$ indicates the length of your target text, $m$ indicates the number of times you press the key.\u003cbr\u003e\u003cbr\u003eSecond line has a string of length $n$, which contains only lowercase letters.\u003cbr\u003e\u003cbr\u003eFor next $m$ lines, each line has a character $ch$ and an integer $k$, their meanings are described above.\u003cbr\u003e\u003cbr\u003e$1 \\leq n, m \\leq 2 \\times 10^5, 0 \\leq k \\leq 10^9, \\sum {(n+m)} \\leq 2\\times 10^6$"}},{"title":"Output","value":{"format":"HTML","content":"In each case, print \u0027yes\u0027 or \u0027no\u0027, without quote."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n6 6\r\niloveu\r\ni 1\r\nl 1\r\no 1\r\nv 1\r\ne 1\r\nu 0\r\n6 10\r\nimfive\r\nu 10\r\n- 20\r\ni 1\r\nm 1\r\nf 1\r\ni 1\r\nv 5\r\n- 4\r\ne 2\r\n- 2\r\n4 4\r\nabab\r\na 2\r\nb 2\r\n- 3\r\nb 1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eno\r\nyes\r\nno\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}