#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int n;
  cin>>n;
  int x[n];
  for(int i=0;i<n;i++) scanf("%lld",x+i);
  set<int> s;
  int u=1;
  for(int i=0;i<n;i++){
    if(s.count(0)){
      cout<<"No"<<endl;
      continue;
    }
    int k=x[i];
    while(s.count(u)) u++;
    if(k<u-1||(k==u-1&&(int)s.size()!=u-1)){
      puts("No");
      continue;
    }
    puts("Yes");
    while(s.count(k)) s.erase(k--);
    s.insert(k);
  }
  return 0;
}
### Prompt

Your task is to create a CPP solution to the following problem:

Example

Input

6
2
3
1
1
4
2


Output

Yes
Yes
Yes
No
Yes
No

### Response

```cpp
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int n;
  cin>>n;
  int x[n];
  for(int i=0;i<n;i++) scanf("%lld",x+i);
  set<int> s;
  int u=1;
  for(int i=0;i<n;i++){
    if(s.count(0)){
      cout<<"No"<<endl;
      continue;
    }
    int k=x[i];
    while(s.count(u)) u++;
    if(k<u-1||(k==u-1&&(int)s.size()!=u-1)){
      puts("No");
      continue;
    }
    puts("Yes");
    while(s.count(k)) s.erase(k--);
    s.insert(k);
  }
  return 0;
}
```