#!/usr/bin/env python
 
import sys
 
n= int(sys.stdin.readline())
ai = [ int(x) for x in sys.stdin.readline().split() ]

a = list(set(ai))
na= len(a)
ans= "No"
if na==1 and a[0]==0: ans="Yes"
elif na==2 and 0 in a:
    x= a[0]
    if x==0: x= a[1]
    if ai.count(x)==ai.count(0): ans= "Yes"
elif na==3:
    x,y,z= [ ai.count(i) for i in a ]
    if x==y==z: ans="Yes"
#
print( ans )
