S=[] T=[] Q=int(input()) for _ in range(Q): q=list(input().split()) if q[0]=="1": S.append(q[1]) if q[1]==")" and (len(T)>=3 and T[-2:]==["(","|"]):T.pop();T.pop() else:T.append(q[1]) else: S.pop() if T:T.pop() print("Yes" if T==[] or T==["(","|",")"] else "No")