n=int(input())
a=sorted(list(map(int,input().split())))
ans="Yes"
if n>3:
    for i in range(n-1):
        if a.count(a[i])!=a.count(a[i+1]) or a.count(a[i])==1:
            ans="No"
            break
print(ans)