n = int(input()) a = [int(input()) for _ in range(1 << n)] for i in range(1 << n): j = i & -i if a[i] ^ a[j] ^ a[i ^ j]: exit(print("No")) print("Yes")