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: st.pop() if len(st0) == 0: st0 = st[:] else: st0.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')