#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
multiset<i_i> st;
int N;

void print() {
    return;
    for(auto tmp : st) {
        cerr << "(" << tmp.first << ", " << tmp.second << ") ";
    }
    cerr << endl;
}

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N;
    st.insert({0, 1});
    st.insert({2e9, 2e9});
    for(int i = 1; i <= N; i++) {
        print();
        int x;
        cin >> x;
        auto itr = st.lower_bound({x, 2e9});
        if(itr == st.begin()) {
            cout << "No" << endl;
            continue;
        } else {
            cout << "Yes" << endl;
        }
        itr--;
        i_i now = *itr;
        st.erase(itr);
        if(now.second > x) {
            i_i sub = {now.first, x};
            if(sub.first != sub.second) st.insert(sub);
            sub = {x + 1, now.second};
            if(sub.first != sub.second) st.insert(sub);
        } else {
            i_i sub = {now.first, now.second - 1};
            if(sub.first != sub.second) st.insert(sub);
            sub = {now.second, x + 1};
            if(sub.first != sub.second) st.insert(sub);
            //now.first++;
            //now.second = x + 1;
            //st.insert(now);
        }
    }
    return 0;
}

### Prompt

Please create a solution in cpp 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;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
multiset<i_i> st;
int N;

void print() {
    return;
    for(auto tmp : st) {
        cerr << "(" << tmp.first << ", " << tmp.second << ") ";
    }
    cerr << endl;
}

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N;
    st.insert({0, 1});
    st.insert({2e9, 2e9});
    for(int i = 1; i <= N; i++) {
        print();
        int x;
        cin >> x;
        auto itr = st.lower_bound({x, 2e9});
        if(itr == st.begin()) {
            cout << "No" << endl;
            continue;
        } else {
            cout << "Yes" << endl;
        }
        itr--;
        i_i now = *itr;
        st.erase(itr);
        if(now.second > x) {
            i_i sub = {now.first, x};
            if(sub.first != sub.second) st.insert(sub);
            sub = {x + 1, now.second};
            if(sub.first != sub.second) st.insert(sub);
        } else {
            i_i sub = {now.first, now.second - 1};
            if(sub.first != sub.second) st.insert(sub);
            sub = {now.second, x + 1};
            if(sub.first != sub.second) st.insert(sub);
            //now.first++;
            //now.second = x + 1;
            //st.insert(now);
        }
    }
    return 0;
}

```