### A

N = int(input())
a_all = list(map(int, input().split()))
t = list(set(a_all))

if len(a_all)==3:
    if (a_all[0]^a_all[1]==a_all[2]):
        print("Yes")
elif len(t)==2:
    a=0
    b=0
    for i in a_all:
        if i==t[0]:
            a+=1
        else:
            b+=1
    if(a == b*2 or  b == a*2):
        print("Yes")
    else:
        print("No")
elif len(t)==1:
    if t[0]^t[0]==t[0]:
        print("Yes")
    else:
        print("No")

else:
    print("No")