import sys
n = int(input())
a = [int(i) for i in input().split()]
for i in range(n - 1):
    if (a[i - 1] ^ a[i + 1] != a[i]):
        print('No')
        sys.exit(0)
print('Yes' if a[0] ^ a[-2] == a[-1] else 'No')