N = int(input()) A = list() for _ in range(2**N): a = int(input()) A.append(a) #print(A) for i in range(len(A)): for j in range(len(A)): n = A[int(bin((i)^(j)),2)] m = int(bin(A[i]^A[j]),2) #print(n,m) if n != m: print("No") exit() print("Yes")