//Copyright(c)2017 Mstdream
#include<bits/stdc++.h>
using namespace std;

inline void splay(int &v){
	v=0;char c=0;int p=1;
	while(c<'0' || c>'9'){if(c=='-')p=-1;c=getchar();}
	while(c>='0' && c<='9'){v=(v<<3)+(v<<1)+c-'0';c=getchar();}
	v*=p;
}
set<int>s;
int now=1,fir;
int main(){
	int n;splay(n);
	for(int i=1;i<=n;i++){
		int x;splay(x);
		if(fir){
			puts("No");
			continue;
		}
		else if(x==now-1&&s.size()==now-1){
			fir=1;
			puts("Yes");
			continue;
		}
		else if(x<now)puts("No");
		else{
			while(s.find(x)!=s.end()){
				s.erase(x);
				x--;
			}
			s.insert(x);
			while(s.find(now)!=s.end())now++;
			puts("Yes");
		}
	}
}
### Prompt

Create a solution in CPP for the following problem:

Example

Input

6
2
3
1
1
4
2


Output

Yes
Yes
Yes
No
Yes
No

### Response

```cpp
//Copyright(c)2017 Mstdream
#include<bits/stdc++.h>
using namespace std;

inline void splay(int &v){
	v=0;char c=0;int p=1;
	while(c<'0' || c>'9'){if(c=='-')p=-1;c=getchar();}
	while(c>='0' && c<='9'){v=(v<<3)+(v<<1)+c-'0';c=getchar();}
	v*=p;
}
set<int>s;
int now=1,fir;
int main(){
	int n;splay(n);
	for(int i=1;i<=n;i++){
		int x;splay(x);
		if(fir){
			puts("No");
			continue;
		}
		else if(x==now-1&&s.size()==now-1){
			fir=1;
			puts("Yes");
			continue;
		}
		else if(x<now)puts("No");
		else{
			while(s.find(x)!=s.end()){
				s.erase(x);
				x--;
			}
			s.insert(x);
			while(s.find(now)!=s.end())now++;
			puts("Yes");
		}
	}
}
```