N = int(input())
arr = list(map(int, input().split()))
ans = 'Yes'

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)