Q = int(input()) p = 0 st = [None] * (Q+1) for _ in range(Q): qs = input().split() match qs: case ('1', c): if c == ')': if p-2 >= 0 and st[p-2][0] == '(' and st[p-1][0] == '|': st[p] = (c, True) else: st[p] = (c, False) else: st[p] = (c, False) p += 1 case ('2',): p -= 1 case _: assert False if p == 0 or st[p-1][1]: print('Yes') else: print('No')