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