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:

  1. add element to the end of the queue;
  2. 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.

Input

The 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 '-'.

Output

Print n lines. In each line print 'Yes' (if it is possible to pick a good subset from the queue), or 'No' otherwise.

ExamplesInput
2
+ 42
-
Output
Yes
No
Input
5
+ 2
+ 8
+ 32
+ 11
-
Output
No
No
Yes
Yes
No

加入题单

算法标签: