import sys input = sys.stdin.readline n = int(input()) A = [int(input()) for _ in range(pow(2, n))] Pow2 = [pow(2, i) for i in range(n)] if A[0] != 0: print("No") exit() if n >= 2: for i in range(1, n): temp = A[Pow2[i]] for j in range(1, pow(2, i)): res = temp ^ A[Pow2[i] + j] if res != A[j]: print("No") exit() print("Yes")