import collections
N = int(input())
W = list(map(int, input().split()))
c = dict(collections.Counter(W))

if len(c.keys()) == 1:
  if c.get(0, False) == False:
    print('No')
  else:
    print('Yes')
if len(c.keys()) == 2:
  num = list(c.values())
  num = sorted(num)
  if 0 in c:
    if c[0]*2 == num[1]:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
if len(c.keys()) == 3:
  num = list(c.values())
  if num[0] == num[1]:
    if num[0] == num[2]:
      print("Yes")
  else:
    print("No")
if len(c.keys()) >= 4:
  print("No")