def solve(): N = int(input()) A = [0] * (1 << N) for i in range(1 << N): A[i] = int(input()) bit = lambda S, k : (S >> k) & 1 def xor_sum(S): xor = 0 for j in range(N): if bit(S, j): xor ^= A[1 << j] return xor return all(A[S] == xor_sum(S) for S in range(1 << N)) #================================================== import sys input=sys.stdin.readline write=sys.stdout.write print("Yes" if solve() else "No")