N = input()
a = list(map(int,input().split()))
el = sorted(list(set(a)))

if len(el) == 1:
  if el[0] == 0:
    print("Yes")
  else:
    print("No")
elif len(el) == 2 :
  if a.count(0)*2 == a.count(el[1]):
    print("Yes")
  else:
    print("No")
elif len(el) == 3:
      print("Yes")
else:
  print("No")
  
  
  