Q = int(input().strip()) st = [''] * 800005 history_sz = [0] * 800005 sz = 0 L = 0 for q in range(Q): data = input().split() if data[0] == "1": L += 1 st[sz] = data[1] sz += 1 if sz >= 3 and st[sz-3] == '(' and st[sz-2] == '|' and st[sz-1] == ')': sz -= 3 history_sz[L] = sz if sz == 0: print("Yes") else: print("No") else: L -= 1 sz = history_sz[L] if sz == 0: print("Yes") else: print("No")