from itertools import permutations
n=int(input())
aa=list(map(int,input().split()))
sa=set(aa)
if n%3==0 and len(sa)==3:
    for ap in permutations(sa):
        for i in range(3):
            if ap[i-1]!=ap[i-2]^ap[i]:
                break
        else:
            print("Yes")
            exit()
elif sum(aa)==0:
    print("Yes")
    exit()
print("No")
