N = int(input())
a = list(map(int, input().split()))
ans = "Yes"

if(a[1]^a[N-1] != a[0]):
    ans = "No"
elif(a[N-2]^a[0] != a[N-1]):
    ans = "No"
else:
    for i in range(1, N-1):
        if(a[i-1]^a[i+1] != a[i]):
            ans ="No"
            break
print(ans)