#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repp(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perr(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)

typedef long long LL;
typedef long double LD;

int main(){
  int n;
  cin >> n;
  int now=0;
  set<int> st;
  int x;
  bool ok=false;
  rep(i,n){
    cin >> x;
    if(ok){
      cout << "No" << endl;
      continue;
    }
    if(x<now){
      cout << "No" << endl;
    }else if(x==now){
      if(st.upper_bound(x)==st.end()){
        cout << "Yes" << endl;
        ok=true;
      }else{
        cout << "No" << endl;
      }
    }else{
      auto itr = st.find(x);
      while(itr!=st.end()){
        st.erase(itr);
        x--;
        itr = st.find(x);
      }
      st.insert(x);
      itr = st.find(now+1);
      while(itr!=st.end()){
        now++;
        itr = st.find(now+1);
      }
      cout << "Yes" << endl;
    }
  }

  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 rep(i, n) for(int i = 0; i < (n); i++)
#define repp(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perr(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)

typedef long long LL;
typedef long double LD;

int main(){
  int n;
  cin >> n;
  int now=0;
  set<int> st;
  int x;
  bool ok=false;
  rep(i,n){
    cin >> x;
    if(ok){
      cout << "No" << endl;
      continue;
    }
    if(x<now){
      cout << "No" << endl;
    }else if(x==now){
      if(st.upper_bound(x)==st.end()){
        cout << "Yes" << endl;
        ok=true;
      }else{
        cout << "No" << endl;
      }
    }else{
      auto itr = st.find(x);
      while(itr!=st.end()){
        st.erase(itr);
        x--;
        itr = st.find(x);
      }
      st.insert(x);
      itr = st.find(now+1);
      while(itr!=st.end()){
        now++;
        itr = st.find(now+1);
      }
      cout << "Yes" << endl;
    }
  }

  return 0;
}


```