N = int(input())
arr = list(map(int, input().split()))
arr.sort()
ans = 'Yes'
tmp0 = arr.count(0)
tmp1 = arr.count(1)
if tmp0 * 2 == tmp1 and tmp0 <= 2:
    print(ans)
    exit()

for i in range(N):
    if i == 0:
        if (arr[N-1] ^ arr[1]) == arr[0]:
            continue
        else:
            ans = 'No'
            break
    elif i == N-1:
        if (arr[N-2] ^ arr[0]) == arr[N-1]:
            continue
        else:
            ans = 'No'
            break
    else:
        if (arr[i-1] ^ arr[i+1]) == arr[i]:
            continue
        else:
            ans = 'No'
            break

print(ans)

