N=int(input())
A=list(map(int,input().split()))
SA=set(A)
if N%3==0:
    if len(SA)==3:
        x=[0,0,0]
        for i,a in enumerate(SA):
            x[i]=A.count(a)
        if x[0]==x[1] and x[1]==x[2]:
            print('Yes')
        else:
            print('No')
    elif len(SA)==2:
        x=[0,0]
        for i,a in enumerate(SA):
            x[i]=A.count(a)
        if x[0]*2==x[1] or x[1]*2==x[0]:
            print('Yes')
        else:
            print('No')
    elif  A[0]==0:
        print('Yes')
    else:
        print('No')
            
        
        
else:
    if len(SA)==1 and A[0]==0:
        print('Yes')
    else:
        print('No')