from collections import defaultdict as dd
n = int(input())
a = [int(i) for i in input().split()]
if n%3 and sum(a): print("No")
elif n%3: print("Yes")
else:
    d,x = dd(int),[]
    for i in a: d[i]+=1
    if len(d)==2 and d[0]==n//3: print("Yes")
    elif len(d)==2: print("No")
    elif len(d)!=3: print("No")
    else:
        for i in d.keys(): x.append(i)
        if x[0]^x[1]==x[2]: print("Yes")
        else: print("No")