n=int(input())
a=list(map(int,input().split()))
if len(set(a))==1 and 0 in set(a):
    print("Yes")
    exit()
if len(set(a))>3:
    print("No")
    exit()
if len(set(a))==2 and 0 in set(a):
    print("Yes")
    exit()
if n%3!=0:
    print("No")
    exit()
for i in a:
    for j in a:
        if i==j:
            continue
        for k in a:
            if i==k or j==k:
                continue
            if i^j^k!=0:
                print("No")
                exit()
            if a.count(i)==n//3 and a.count(j)==n//3:
                print("Yes")
                exit()
            else:
                print("No")
                exit()