{"problem":{"name":"Prefix Equality","description":{"content":"You are given integer sequences $A = (a_1,\\ldots,a_N)$ and $B = (b_1,\\ldots,b_N)$, each of length $N$. For $i=1,...,Q$, answer the query in the following format. *   If the set of values contained in","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":4000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc250_e"},"statements":[{"statement_type":"Markdown","content":"You are given integer sequences $A = (a_1,\\ldots,a_N)$ and $B = (b_1,\\ldots,b_N)$, each of length $N$.\nFor $i=1,...,Q$, answer the query in the following format.\n\n*   If the set of values contained in the first $x_i$ terms of $A$, $(a_1,\\ldots,a_{x_i})$, and the set of values contained in the first $y_i$ terms of $B$, $(b_1,\\ldots,b_{y_i})$, are equal, then print `Yes`; otherwise, print `No`.\n\n## Constraints\n\n*   $1 \\leq N,Q \\leq 2 \\times 10^5$\n*   $1 \\leq a_i,b_i \\leq 10^9$\n*   $1 \\leq x_i,y_i \\leq N$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$a_1$ $\\ldots$ $a_N$\n$b_1$ $\\ldots$ $b_N$\n$Q$\n$x_1$ $y_1$\n$\\vdots$\n$x_Q$ $y_Q$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc250_e","tags":[],"sample_group":[["5\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","Yes\nYes\nYes\nNo\nNo\nYes\nNo\n\nNote that sets are a concept where it matters only whether each value is contained or not.  \nFor the $3$\\-rd query, the first $2$ terms of $A$ contain one $1$ and one $2$, while the first $3$ terms of $B$ contain one $1$ and two $2$'s. However, the sets of values contained in the segments are both ${ 1,2 }$, which are equal.  \nAlso, for the $6$\\-th query, the values appear in different orders, but they are still equal as sets."]],"created_at":"2026-03-03 11:01:14"}}