N=int(input())
l=list(map(int,input().split()))
s=list(set(l))
if len(s) == 3:
    if s[0]==s[1]^s[2]:
        print("Yes")
    else:
        print("No")
elif len(s) == 2:
    if s[0]==s[1]^s[1] or s[1]==s[0]^s[0]:
        print("Yes")
    else:
        print("No")
elif len(s) == 1 and s[0] == 0:
    print("Yes")
else:
    print("No")
