N = input()
b = list(map(int, input().split()))
a = list(set(b))

for i in range(len(a)):
    if i == 0:
        if not a[-1] ^ a[i+1] == a[i]:
            print('No')
            break
    elif i == len(a)-1:
        if a[0] ^ a[-2] == a[i]:
            print('Yes')
            break
        else:
            print('No')
            break
    else:
        if not a[i-1] ^ a[i+1] == a[i]:
            print('No')
            break