import sys input = sys.stdin.readline Q=int(input()) A=[] X=[] for tests in range(Q): L=input().split() if L[0]=="1": x=L[1] A.append(x) X.append(x) while len(X)>=3 and X[-1]==")" and X[-2]=="|" and X[-3]=="(": X.pop() X.pop() X.pop() else: k=A.pop() if X and X[-1]==k: X.pop() else: X.append("(") X.append("|") if X==[]: print("Yes") else: print("No")