q = int(input()) st = [] for i in range(q): qi = input().split() if qi[0] == '1': st.append(qi[1]) else: if len(st) == 0: st.append('(') st.append('|') else: st.pop() if len(st) >= 3 and st[-3] == '(' and st[-2] == '|' and st[-1] == ')': for j in range(3): st.pop() print('Yes' if len(st) == 0 else 'No')