import sys input = sys.stdin.readline N = int(input()) N2 = 1 << N A = [0] * N2 for i in range(N2): A[i] = int(input()) v = 0 for j in range(N): if (i >> j) & 1: v ^= A[1 << j] if A[i] != v: print("No") exit() print("Yes")