Q = int(input()) S = "" for i in range(Q): query = input() if query[0] == "1": S += query[2] else: S = S[:-1] S_exp = S[:] while "(|)" in S_exp: S_exp = S_exp.replace("(|)", "") if S_exp == "": print("Yes") else: print("No")