{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"陈世进找了一串长度为n的括号序列P,并且P是合法的括号序列。\n合法的括号序列是这样定义的:\n1.空串合法。\n2.如果A合法,B合法,那么AB也合法的。\n3.如果A合法,那么(A)也合法。\n这时唐威豪也发现了这个括号序列,由于上次陈世进陪唐威豪看电影跑去了玩游戏,\n他决定每一天早上对这个括号序列的第ai个括号和第bi个括号交换,然后每一天晚上又恢复原样。\n这可把陈世进急坏了,现在陈世进想知道每天中午的时候,这个括号序列是否合法。"}},{"title":"Input","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cdiv\u003e\n The input contains at most 30 sets. For each set:\n \u003c/div\u003e \n \u003cdiv\u003e\n The first line contains two integers n,q (2≤n≤10\n \u003csup\u003e5\u003c/sup\u003e,1≤q≤10\n \u003csup\u003e5\u003c/sup\u003e).\n \u003c/div\u003e \n \u003cdiv\u003e\n The second line contains n characters p\n \u003csub\u003e1\u003c/sub\u003e p\n \u003csub\u003e2\u003c/sub\u003e…p\n \u003csub\u003en\u003c/sub\u003e.\n \u003c/div\u003e \n \u003cdiv\u003e\n The i-th of the last q lines contains 2 integers a\n \u003csub\u003ei\u003c/sub\u003e,b\n \u003csub\u003ei\u003c/sub\u003e (1≤a\n \u003csub\u003ei\u003c/sub\u003e,b\n \u003csub\u003ei\u003c/sub\u003e≤n,a\n \u003csub\u003ei\u003c/sub\u003e≠b\n \u003csub\u003ei\u003c/sub\u003e).\n \u003c/div\u003e \n \u003cp\u003e\u003c/p\u003e\n \u003c/body\u003e\n\u003c/html\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cdiv\u003e\n For each question, output \"\n \u003cem\u003eYes\u003c/em\u003e\" if P remains balanced, or \"\n \u003cem\u003eNo\u003c/em\u003e\" otherwise.\n \u003c/div\u003e\n \u003c/body\u003e\n\u003c/html\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e4 2\n(())\n1 3\n2 3\n2 1\n()\n1 2\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003eNo\nYes\nNo\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\u003c/body\u003e\n\u003c/html\u003e"}}]}