n=int(input())
a=list(map(int,input().split()))
a_2=[]
for i in range(len(a)):
    a_2.append(bin(a[i]))
import collections
c = collections.Counter(a)
b=[]
for i in c.values():
    b.append(i)
if a.count(0)==0:
    for i in range(len(b)):
        if len(b)%3!=0:
            print('No')
            break
        elif b[i]!=b[i+1] and i!=len(b)-2:
            print('No')
            break
        elif i==len(b)-2:
            print('Yes')
            break
        else:
            pass
else:
    if len(b)!=2:
        print('No')
    else:
        if a.count(0)*3==len(a):
            print('Yes')
        else:
            print('No')