405850: GYM102135 C Good subset
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
C. Good subsettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
Let's call set X good, if XOR-sum of all elements is 42.
You have a queue (initially empty). n operations of two types are performed:
- add element to the end of the queue;
- extract element from the beginning of the queue;
You have to answer after each operation: can we pick a good subset from the queue, or not.
InputThe first line contains one integer n (1 ≤ n ≤ 100 000) — number of queries.
Next n lines contain operations. Operation of the first type is described in format '+ x', where x (0 ≤ x ≤ 42) — the number you have to add to the queue. Operation of the second type is written as character '-'.
OutputPrint n lines. In each line print 'Yes' (if it is possible to pick a good subset from the queue), or 'No' otherwise.
ExamplesInput2Output
+ 42
-
YesInput
No
5Output
+ 2
+ 8
+ 32
+ 11
-
No
No
Yes
Yes
No