#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#define maxx 2000000000
using namespace std;
int n,x,now,cnt;
map<int,int>mp;
int main()
{
  scanf("%d",&n);
  now=1;
  for (int i=1;i<=n;i++)
  {
  	scanf("%d",&x);
  	if (x<now) printf("No\n");
  	else
  	{ 
  	  printf("Yes\n");
  	  while ((mp[x]>0)&&(x>0))
  	  {
  	    mp[x]=0;
  	    cnt--;
  	    x--;
	  }
	  mp[x]=1; cnt++;
	  while ((mp[now]>0)&&(now<=n)) now++;
	  now=min(cnt,now);
	  if (x==0) now=maxx;
    }
  }
  return 0;
}
### Prompt

Your challenge is to write 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<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#define maxx 2000000000
using namespace std;
int n,x,now,cnt;
map<int,int>mp;
int main()
{
  scanf("%d",&n);
  now=1;
  for (int i=1;i<=n;i++)
  {
  	scanf("%d",&x);
  	if (x<now) printf("No\n");
  	else
  	{ 
  	  printf("Yes\n");
  	  while ((mp[x]>0)&&(x>0))
  	  {
  	    mp[x]=0;
  	    cnt--;
  	    x--;
	  }
	  mp[x]=1; cnt++;
	  while ((mp[now]>0)&&(now<=n)) now++;
	  now=min(cnt,now);
	  if (x==0) now=maxx;
    }
  }
  return 0;
}
```