N = int(input())
A = list(map(int,input().split()))

if N % 3 == 0:
    check = False
    for i in range(N-1):
        a1 = A[i]
        a2 = A[i+1]
        a3 = A[ (i+2+N) % N ]
        if a1^a2^a3 == 0:
            check = True
        else:
            check = False
            break
    if check:
        print("Yes")
        exit()
        
print("No")