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