import sys input = sys.stdin.readline def solve(): Q = int(input()) stack = [] ops_history = [] out = [] for _ in range(Q): line = input().split() if line[0] == '1': c = line[1] if c == ')' and len(stack) >= 2 and stack[-1] == '|' and stack[-2] == '(': ops_history.append(('pop2',)) stack.pop(); stack.pop() else: ops_history.append(('push', c)) stack.append(c) else: op = ops_history.pop() if op[0] == 'push': stack.pop() else: stack.append('('); stack.append('|') out.append('Yes' if not stack else 'No') sys.stdout.write('\n'.join(out) + '\n') solve()