{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"MD","content":"## 题目描述\n\n给定长度为 $N$ 的整数序列 $A \u003d (a_1, \\dots, a_N)$ 和 $B \u003d (b_1, \\dots, b_N)$。\n\n对于 $i \u003d 1, \\dots, Q$,回答以下询问:\n\n* 如果 $A$ 的前 $x_i$ 项数值构成的集合与 $B$ 的前 $y_i$ 项相同,输出 `Yes`,否则输出 `No`。\n\n## 数据范围\n\n* $1 \\le N, Q \\le 2 \\times 10^5$\n* $1 \\le a_i, b_i \\le 10^9$\n* $1 \\le x_i, y_i \\le N$\n* 所有输入均为整数。\n\n## 输入格式\n\n见原题面。\n\n## 输出格式\n\n输出 $Q$ 行,第 $i$ 行为第 $i$ 次询问的答案。\n\n\u003csection\u003e\n \u003cp\u003eYou are given integer sequences \u003cvar\u003e\\(A \u003d (a_1,\\ldots,a_N)\\)\u003c/var\u003e and \u003cvar\u003e\\(B \u003d (b_1,\\ldots,b_N)\\)\u003c/var\u003e, each of length \u003cvar\u003e\\(N\\)\u003c/var\u003e.\u003c/p\u003e\n \u003cp\u003eFor \u003cvar\u003e\\(i\u003d1,...,Q\\)\u003c/var\u003e, answer the query in the following format.\u003c/p\u003e\n \u003cul\u003e\n \u003cli\u003eIf the set of values contained in the first \u003cvar\u003e\\(x_i\\)\u003c/var\u003e terms of \u003cvar\u003e\\(A\\)\u003c/var\u003e, \u003cvar\u003e\\((a_1,\\ldots,a_{x_i})\\)\u003c/var\u003e, and the set of values contained in the first \u003cvar\u003e\\(y_i\\)\u003c/var\u003e terms of \u003cvar\u003e\\(B\\)\u003c/var\u003e, \u003cvar\u003e\\((b_1,\\ldots,b_{y_i})\\)\u003c/var\u003e, are equal, then print \u003ccode\u003eYes\u003c/code\u003e; otherwise, print \u003ccode\u003eNo\u003c/code\u003e.\u003c/li\u003e\n \u003c/ul\u003e\n\u003c/section\u003e"}},{"title":"Constraints","value":{"format":"MD","content":"\u003csection\u003e\n \u003cul\u003e\n \u003cli\u003e\u003cvar\u003e\\(1 \\leq N,Q \\leq 2 \\times 10^5\\)\u003c/var\u003e\u003c/li\u003e\n \u003cli\u003e\u003cvar\u003e\\(1 \\leq a_i,b_i \\leq 10^9\\)\u003c/var\u003e\u003c/li\u003e\n \u003cli\u003e\u003cvar\u003e\\(1 \\leq x_i,y_i \\leq N\\)\u003c/var\u003e\u003c/li\u003e\n \u003cli\u003eAll values in input are integers.\u003c/li\u003e\n \u003c/ul\u003e\n\u003c/section\u003e"}},{"title":"Input","value":{"format":"MD","content":"\u003csection\u003e\n \u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e\n \u003cpre\u003e\u003cvar\u003e\\(N\\)\u003c/var\u003e\n\u003cvar\u003e\\(a_1\\)\u003c/var\u003e \u003cvar\u003e\\(\\ldots\\)\u003c/var\u003e \u003cvar\u003e\\(a_N\\)\u003c/var\u003e\n\u003cvar\u003e\\(b_1\\)\u003c/var\u003e \u003cvar\u003e\\(\\ldots\\)\u003c/var\u003e \u003cvar\u003e\\(b_N\\)\u003c/var\u003e\n\u003cvar\u003e\\(Q\\)\u003c/var\u003e\n\u003cvar\u003e\\(x_1\\)\u003c/var\u003e \u003cvar\u003e\\(y_1\\)\u003c/var\u003e\n\u003cvar\u003e\\(\\vdots\\)\u003c/var\u003e\n\u003cvar\u003e\\(x_Q\\)\u003c/var\u003e \u003cvar\u003e\\(y_Q\\)\u003c/var\u003e\n\u003c/pre\u003e\n\u003c/section\u003e"}},{"title":"Output","value":{"format":"MD","content":"\u003csection\u003e\n \u003cp\u003ePrint \u003cvar\u003e\\(Q\\)\u003c/var\u003e lines. The \u003cvar\u003e\\(i\\)\u003c/var\u003e-th line should contain the response to the \u003cvar\u003e\\(i\\)\u003c/var\u003e-th query.\u003c/p\u003e\n\u003c/section\u003e"}},{"title":"Sample 1","value":{"format":"MD","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\u003e5\n1 2 3 4 5\n1 2 2 4 3\n7\n1 1\n2 2\n2 3\n3 3\n4 4\n4 5\n5 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\nYes\nYes\nNo\nNo\nYes\nNo\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003csection\u003e\n\u003c/section\u003e\u003csection\u003e\n \u003cp\u003eNote that sets are a concept where it matters only whether each value is contained or not.\u003cbr\u003e\n For the \u003cvar\u003e\\(3\\)\u003c/var\u003e-rd query, the first \u003cvar\u003e\\(2\\)\u003c/var\u003e terms of \u003cvar\u003e\\(A\\)\u003c/var\u003e contain one \u003cvar\u003e\\(1\\)\u003c/var\u003e and one \u003cvar\u003e\\(2\\)\u003c/var\u003e, while the first \u003cvar\u003e\\(3\\)\u003c/var\u003e terms of \u003cvar\u003e\\(B\\)\u003c/var\u003e contain one \u003cvar\u003e\\(1\\)\u003c/var\u003e and two \u003cvar\u003e\\(2\\)\u003c/var\u003e\u0027s. However, the sets of values contained in the segments are both \u003cvar\u003e\\(\\{ 1,2 \\}\\)\u003c/var\u003e, which are equal.\u003cbr\u003e\n Also, for the \u003cvar\u003e\\(6\\)\u003c/var\u003e-th query, the values appear in different orders, but they are still equal as sets.\u003c/p\u003e\n\u003c/section\u003e"}}]}