- Time limit: 2.00 s
- Memory limit: 512 MB
Uolevi is creating a list of numbers. He is particularly interested in bitwise XORs of the numbers in his list. Sometimes Uolevi wonders if it is possible to form a given number as a bitwise XOR of one or more numbers in his list.
To help Uolevi, implement a data structure that maintains a list of numbers and supports the following operations:
- Add a number to the list
- Determine if it is possible to select one or more numbers in the list such that the bitwise XOR of the numbers is equal to a given number
Initially the list is empty.
Input
The first line contains an integer , the number of queries. Next lines each contain two integers and where is the type of the query. If the type is , you should add to the list. If the type is you should determine if it is possible to form .
Output
For each query of type , output YES
if it is possible to select one or more numbers in the list whose bitwise XOR is equal to , and otherwise output NO
.
Constraints
Example
Input:
6 1 1 1 2 1 4 2 5 2 7 2 0
Output:
YES YES NO
Input:
5 2 5 1 3 2 1 1 6 2 5
Output:
NO NO YES