n = int(input())
a = list(map(int, input().split()))

ans = 'Yes'

if n % 2 == 0:
    ans = 'No'

if ans == 'Yes':
    a = sorted(a)
    for i in range(n-1):
        if bin(a[i]) == bin(a[i-1] ^ a[i+1]):
            pass
        else:
            ans = 'No'
            break

if ans == 'Yes':
    if bin(a[n-1]) == bin(a[n-2] ^ a[0]):
        pass
    else:
        ans = 'No'

print(ans)
