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