#include<bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
typedef long long LL;
typedef pair<int,int> PII;
#define X first
#define Y second
inline int read()
{
int x=0,f=1;char c=getchar();
while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
while(isdigit(c)){x=x*10+c-'0';c=getchar();}
return x*f;
}
const int maxn=200010;
int n,q,tp[maxn],a[maxn],b[maxn],tag[maxn<<2],w[maxn<<2];
multiset <int> S;
multiset <int>::iterator it,it2;
void pushdown(int L,int R,int o)
{
int mid=L+R>>1,lo=o<<1,ro=lo|1;
tag[lo]+=tag[o];tag[ro]+=tag[o];
w[lo]+=tag[o];w[ro]+=tag[o];
tag[o]=0;
}
void update(int L,int R,int o,int ql,int qr,int v)
{
if(L==ql && R==qr)
{
w[o]+=v;
tag[o]+=v;
return;
}
pushdown(L,R,o);
int mid=L+R>>1,lo=o<<1,ro=lo|1;
if(qr<=mid)update(L,mid,lo,ql,qr,v);
else if(ql>mid)update(mid+1,R,ro,ql,qr,v);
else update(L,mid,lo,ql,mid,v),update(mid+1,R,ro,mid+1,qr,v);
}
int query(int L,int R,int o,int qx)
{
if(L==R)return w[o];
pushdown(L,R,o);
int mid=L+R>>1,lo=o<<1,ro=lo|1;
if(qx<=mid)return query(L,mid,lo,qx);
else return query(mid+1,R,ro,qx);
}
void insert(int A)
{
int pos=lower_bound(b+1,b+n+1,A)-b,l,r;
it=S.lower_bound(A);
if(it!=S.end() && it!=S.begin())
{
it--;it2=it;it++;
l=lower_bound(b+1,b+n+1,(*it)-*(it2))-b;
r=lower_bound(b+1,b+n+1,(*it)+*(it2))-b-1;
if(*it-*it2==b[l])l++;
update(1,n,1,l,r,-1);
}
if(it!=S.end())
{
l=lower_bound(b+1,b+n+1,*it-A)-b;
r=lower_bound(b+1,b+n+1,*it+A)-b-1;
if(*it-A==b[l])l++;
update(1,n,1,l,r,1);
}
if(it!=S.begin())
{
it--;it2=it;it++;
l=lower_bound(b+1,b+n+1,A-*it2)-b;
r=lower_bound(b+1,b+n+1,*it2+A)-b-1;
if(A-*it2==b[l])l++;
update(1,n,1,l,r,1);
}
S.insert(A);
}
void delt(int A)
{
int pos=lower_bound(b+1,b+n+1,A)-b,l,r;
it=S.find(A);
S.erase(it);
it=S.lower_bound(A);
if(it!=S.end() && it!=S.begin())
{
it--;it2=it;it++;
l=lower_bound(b+1,b+n+1,(*it)-*(it2))-b;
r=lower_bound(b+1,b+n+1,(*it)+*(it2))-b-1;
if(*it-*it2==b[l])l++;
update(1,n,1,l,r,1);
}
if(it!=S.end())
{
l=lower_bound(b+1,b+n+1,*it-A)-b;
r=lower_bound(b+1,b+n+1,*it+A)-b-1;
if(*it-A==b[l])l++;
update(1,n,1,l,r,-1);
}
if(it!=S.begin())
{
it--;it2=it;it++;
l=lower_bound(b+1,b+n+1,A-*it2)-b;
r=lower_bound(b+1,b+n+1,*it2+A)-b-1;
if(A-*it2==b[l])l++;
update(1,n,1,l,r,-1);
}
}
void ask(int x)
{
int pos=lower_bound(b+1,b+n+1,x)-b;
if(query(1,n,1,pos))puts("Yes");
else puts("No");
}
int main()
{
q=read();
for(int i=1;i<=q;i++)tp[i]=read(),a[i]=b[i]=read();
sort(b+1,b+q+1);
n=unique(b+1,b+q+1)-b-1;
b[n+1]=1e9;
for(int i=1;i<=q;i++)
{
if(tp[i]==1)insert(a[i]);
else if(tp[i]==2)delt(a[i]);
else ask(a[i]);
}
return 0;
}