Score : $600$ points
Given is a sequence of $N$ positive integers $A = (A_1, \dots, A_N)$.
Process $Q$ queries. In the $i$-th query $(1 \leq i \leq Q)$, determine whether it is possible to choose one or more elements from $A_{L_i}, A_{L_i + 1}, \dots, A_{R_i}$ so that their $\mathrm{XOR}$ is $X_i$.
The bitwise $\mathrm{XOR}$ of integers $A$ and $B$, $A\ \mathrm{XOR}\ B$, is defined as follows:
Input is given from Standard Input in the following format:
$N$ $Q$ $A_1$ $\ldots$ $A_N$ $L_1$ $R_1$ $X_1$ $\vdots$ $L_Q$ $R_Q$ $X_Q$
Print $Q$ lines. The $i$-th line $(1 \leq i \leq Q)$ should contain Yes
if it is possible to choose one or more elements from $A_{L_i}, A_{L_i + 1}, \dots, A_{R_i}$ so that their $\mathrm{XOR}$ is $X_i$, and No
otherwise.
5 2 3 1 4 1 5 1 3 7 2 5 7
Yes No
In the first query, you can choose $A_1$ and $A_3$, whose $\mathrm{XOR}$ is $7$.
In the second query, there is no way to choose elements so that their $\mathrm{XOR}$ is $7$.
10 10 8 45 56 9 38 28 33 5 15 19 10 10 53 3 8 60 1 10 29 5 7 62 3 7 51 8 8 52 1 4 60 6 8 32 4 8 58 5 9 2
No No Yes No Yes No No No Yes Yes