import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintWriter;
class BRCKTS {
static int a[];
// TODO Auto-generated method stub
StringBuilder sb=new StringBuilder();
int i=1;
while(true){
if(sr==null || sr.equalsIgnoreCase(""))break;
sb.append("Test "+(i++)+":\n");
boolean odd=false;
if((n&1)==1)odd=true;
a=new int[n+1];
for(int j=1;j<=n;j++){
a[j]=s.charAt(j-1)=='('?1:-1;
}
Segment_Tree st=new Segment_Tree(1, n);
int m=r.nextInt();
for(int j=0;j<m;j++){
int q=r.nextInt();
if(q==0){
if(odd)sb.append("NO\n");
else if(st.sum==0 && st.min_sum==0)sb.append("YES\n");
else sb.append("NO\n");
}
else st.update(q);
//System.out.println("H");
}
}
pr.write(sb.toString());
pr.flush();
}
static class Segment_Tree{
int start,end,sum,min_sum;
Segment_Tree left_child,right_child;
public Segment_Tree(){};
public Segment_Tree(int a,int b){
start=a;end=b;
if(start!=end){
int mid=(start+end)>>1;
left_child=new Segment_Tree(a,mid);
right_child=new Segment_Tree(mid+1,b);
join(this,left_child,right_child);
}
else {
sum=min_sum=BRCKTS.a[start]==1?1:-1;
}
}
public void join(Segment_Tree parent,Segment_Tree leftchild,Segment_Tree rightchild){
parent.sum=leftchild.sum+rightchild.sum;
parent.
min_sum=Math.
min(leftchild.
min_sum,rightchild.
min_sum+leftchild.
sum); }
public void update(int index){
if(start==index && end==index){
sum=min_sum=min_sum==1?-1:1;
return ;
}
int mid=(start+end)>>1;
if(index<=mid)left_child.update(index);
else if(index>mid)right_child.update(index);
join(this, left_child, right_child);
}
}
final private int BUFFER_SIZE = 1 << 16;
private byte[] buffer;
private int bufferPointer, bytesRead;
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
byte[] buf = new byte[64];
int cnt = 0, c;
while ((c = read()) != -1) {
if (c == '\n')
break;
buf[cnt++] = (byte) c;
}
return new String(buf,
0, cnt
); }
int ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
long ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
double ret = 0, div = 1;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (c == '.')
while ((c = read()) >= '0' && c <= '9')
ret += (c - '0') / (div *= 10);
if (neg)
return -ret;
return ret;
}
bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
if (bytesRead == -1)
buffer[0] = -1;
}
if (bufferPointer == bytesRead)
fillBuffer();
return buffer[bufferPointer++];
}
if (din == null)
return;
din.close();
}
}
}
/*
12
(()(()(())))
16
0
1
3
0
4
5
6
0
10
0
2
0
1
3
4
0
*/