from sys import stdin N = int(stdin.readline()) A = [0] * (1 << N) A[0] = int(stdin.readline()) if A[0]: print('No') exit() for S in range(1, 1 << N): A[S] = int(stdin.readline()) T = S while T: if A[S] ^ A[T] ^ A[S ^ T]: print('No') exit() T -= 1 T &= S print('Yes')