n=int(input())
a=list(map(int,input().split()))
b=list(set(a))
b.sort()
if len(set(a))>=4:
    print('No')
elif b==[0]:
    print('Yes')
elif len(b)==2:
    c_1=a.count(0)
    c_2=a.count(b[1])
    if 2*c_1==c_2:
        print('Yes')
    else:
        print('No')
elif len(b)==3:
    c_1=a.count(b[0])
    c_2=a.count(b[1])
    c_3=a.count(b[2])
    if c_1==c_2==c_3 and b[0]^b[1]^b[2]:
        print('Yes')
    else:
        print('No')
else:
    print('No')