#include <bits/stdc++.h>
#define N 10000001
using namespace std;
bool num[N];
int top;

bool compare(int x){return top>=0 && top>=max(0,N-x-1);}

void Minus(int x){
  while(1){
    num[x] = !num[x];
    if(num[x] == 0) break;
    x++;
  }
  while(top>=0&&num[top]==0)top--;
}

int main(){
  int n;
  cin>>n;
  num[N-1] = 1;
  top = N-1;
  while(n--){
    int x;
    scanf("%d",&x);
    if(top>=0&&compare(x))printf("Yes\n"),Minus(max(0,N-x-1));
    else printf("No\n");
    
  }
  return 0;
}
### Prompt

Construct a cpp code solution to the problem outlined:

Example

Input

6
2
3
1
1
4
2


Output

Yes
Yes
Yes
No
Yes
No

### Response

```cpp
#include <bits/stdc++.h>
#define N 10000001
using namespace std;
bool num[N];
int top;

bool compare(int x){return top>=0 && top>=max(0,N-x-1);}

void Minus(int x){
  while(1){
    num[x] = !num[x];
    if(num[x] == 0) break;
    x++;
  }
  while(top>=0&&num[top]==0)top--;
}

int main(){
  int n;
  cin>>n;
  num[N-1] = 1;
  top = N-1;
  while(n--){
    int x;
    scanf("%d",&x);
    if(top>=0&&compare(x))printf("Yes\n"),Minus(max(0,N-x-1));
    else printf("No\n");
    
  }
  return 0;
}
```