Note that sets are a concept where it matters only whether each value is contained or not.
For 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.
Also, for the 6-th query, the values appear in different orders, but they are still equal as sets.
-
1≤N,Q≤2×105
-
1≤ai,bi≤109
-
1≤xi,yi≤N
-
All values in input are integers.