from sys import stdin input = stdin.readline Q = int(input()) stack = [] history = [] def reduce_stack(stack): changed = 0 while len(stack) >= 3 and stack[-3:] == ["(", "|", ")"]: stack.pop() stack.pop() stack.pop() changed += 1 return changed for _ in range(Q): query = input().split() if query[0] == "1": c = query[1] stack.append(c) removed = reduce_stack(stack) history.append((c, removed)) else: c, removed = history.pop() for _ in range(removed): stack.append("(") stack.append("|") stack.append(")") stack.pop() print("Yes" if not stack else "No")