| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 41 | 12 | 9 | 42.857% |
Daniyar recently learned a new spell called "Bitvzhuh". Although it is a very high level spell, Daniyar was able to master it completely and unlock its deepest secrets.
"Bitvzhuh", when cast on a set of integers, transforms the set into a new set which contains the XORs of all pairs in the initial set.
Formally, say you have a set $A = \{a_1, a_2, \ldots, a_n\}$ of size $n$. After one "Bitvzhuh", $A$ turns into the set $\{a_i \oplus a_j \mid 1 \le i < j \le n\}$, where $\oplus$ denotes the bitwise XOR operation.
Given the initial set and the number $k$, find out if Daniyar can apply "Bitvzhuh" a certain non-zero number of times so that the resulting set will contain each integer in the range $[1, 2^k - 1]$.
The first line contains two integers $n$ and $k$ ($3 \le n \le 10^6$, $2 \le k \le 62$): the size of the initial set and the parameter.
The second line contains $n$ distinct integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i < 2^k$): the elements of the initial set.
Print a single line with the word "Yes" if the set will contain each integer in the range $[1, 2^k - 1]$ after a certain non-zero number of casts of "Bitvzhuh". Otherwise, print a single line with the word "No".
4 3 1 2 3 4
Yes
4 3 1 2 4 7
No
In the first example, the answer is achieved after two casts:
$\{1, 2, 3, 4\} \rightarrow \{1, 2, 3, 5, 6, 7\} \rightarrow \{1, 2, 3, 4, 5, 6, 7\}$.
In the second example, the first cast turns the set $\{1, 2, 4, 7\}$ into $\{3, 5, 6\}$, and it never changes after.