import sys,itertools,copy
input = sys.stdin.readline
N=int(input().strip())
an=[int(x) for x in input().strip().split()]

if N==3:
    if an[0]^an[1]==an[2]:
        print("Yes")
    else:
        print("No")
elif N%3!=0:
    if len(set(an))==1:
        print("Yes")
    else:
        print("No")
else:
    bn = list(set(an))
    if bn[0]^bn[1]!=bn[2]:
        print("No")
    else:
        for b in bn:
            if an.count(b)%(N/3)!=0:
                print("No")
                break
        else:
            print("Yes")