N = int(input())
A = list(map(int,input().split()))
C = [A[0],A[1],A[0]^A[1]]
flag = 0
for i in range(2,N):
    if A[i] not in C:
        flag = 1
        break
if flag==1:
    print("No")
else:
    if N%3==0:
        print("Yes")
    else:
        if A[0]==A[1]==0:
            print("Yes")
        else:
            print("No")