n=int(input())
a=list(map(int,input().split()))
set_a=set(a)
if len(set_a)==3:
    set_a = list(set_a)
    num0 = a.count(set_a[0])
    num1 = a.count(set_a[1])
    num2 = a.count(set_a[2])
    if (set_a[0]^set_a[1]^set_a[2]==0) and (num0==num2) and (num1==num2):
        print('Yes')
    else:
        print('No')
elif len(set_a)==2:
    set_a = list(set_a)
    num0 = a.count(set_a[0])
    num1 = a.count(set_a[1])
    if (set_a[0]==0 or set_a[1]==0) and (num0==num1):
        print('Yes')
    else:
        print('No')
elif len(set_a)==1:
    if 0 in set_a:
        print('Yes')
    else:
        print('No')
else:
    print('No')