Q=int(input()) from collections import deque q=deque() for _ in range(Q): query=list(input().split()) if query[0]=='1': q.append(query[1]) while len(q)>=3 and q[-3]=='(' and q[-2]=='|' and q[-1]==')': q.pop() q.pop() q.pop() else: if q: q.pop() else: q.append('(') q.append('|') while len(q)>=3 and q[-3]=='(' and q[-2]=='|' and q[-1]==')': q.pop() q.pop() q.pop() if q: print("No") else: print("Yes")