N = int(input())
A = list(map(int,input().split()))
C = {}
for i in range(N):
    a = A[i]
    if a not in C:
        C[a] = 0
    C[a] += 1
if 0 in C and C[0]==N:
    print("Yes")
elif N%3==0:
    C = list(C.items())
    if len(C)==3:
        a = C[0][0]
        b = C[1][0]
        c = C[2][0]
        if C[0][1]==C[1][1]==C[2][1] and a==b^c:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")