from sys import stdin input = stdin.readline Q = int(input()) query = [list(input().split()) for _ in range(Q)] stack = [] stack2 = [] for q in query: if q[0] == "1": c = q[1] if c != ")": stack.append(c) stack2.append(0) elif 2 <= len(stack) and stack[-2:] == ["(", "|"]: for _ in range(2): stack.pop() stack2.append(1) else: stack.append(c) stack2.append(0) else: if stack2.pop() == 1: stack.append("(") stack.append("|") print("Yes" if not stack else "No")