from collections import deque S=[""] T=deque() ind=[0] Q=int(input()) for _ in range(Q): q=list(input().split()) if q[0]=="1": S.append(q[1]) if len(T)==0: T.append(q[1]) ind.append(ind[-1]+1) elif q[1]==")" and len(T)>=2 and (T[-2]=="(" and T[-1]=="|"): T.pop();T.pop() ind.append(ind[-1]-1) else: T.append(q[1]) ind.append(ind[-1]) else: if ind[-1]==ind[-2]: T.pop() else: pre=ind[-2] i=-2 while S[i]!="" and ind[i]==pre: T.appendleft(S[i]) i-=1 S.pop();ind.pop() print("Yes" if len(T)==0 else "No")