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() st0 = st[:] 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')