N=int(input())
a=list(map(int,input().split()))
sum=0
realsum=0

if N%3!=0:
    for j in a:
        realsum+=j
    if realsum==0:
        print('Yes')
    else:
        print('No')
else:
    kind=list(set(a))
    kindnum=len(kind)
    if kindnum == 1:
        if kind[0]==0:
            print('Yes')
        else:
            print('No')
    elif kindnum == 2:
        XOR = kind[0]^kind[1]
        numXOR = 0
        for i in a:
            if i == XOR:
                numXOR +=1
        if XOR == kind[0]:
            notNum = kind[1]
        else:
            notNum = kind[0]
        if numXOR == len(a)/3*2 and a.count(notNum) == len(a)/3:
            print('Yes')
        else:
            print('No')
    elif kindnum == 3:
        if a.count(kind[0]) == a.count(kind[1]) and a.count(kind[0])== a.count(kind[2]):
            print('Yes')
        else:
            print('No')
    else:
        print('No')