a=int(input())
b=list(map(int, input().split()))
c=list(set(b))
t=0
d=[0 for i in range(len(c))]
if len(c)==1:
  if c[0]==0:
    print("Yes")
  else:
    print("No")
elif len(c)==2:
  for i in range(len(c)):
    e=c[i]
    d[i]=b.count(e)
  if (c[0]==0 and d[0]*2==d[1])or (c[1]==0 and d[1]*2==d[0]):
    print("Yes")
  else:
    print("No")
elif len(c)>3:
  print("No")
else:  
  for i in range(len(c)):
    e=c[i]
    d[i]=b.count(e)
  if d[0]==d[1]and d[0]==d[2]:
    print("Yes")
  else:
    print("No")