n = int(input())
a = input()
a = a.split()

nums = {}

for i in range(len(a)):
  if int(a[i]) not in nums:
    nums[int(a[i])] = 1
  else:
    nums[int(a[i])] += 1

#print(nums)

if len(nums) > 3:
  print("No")
else:
  snums = sorted(nums.items())
  #print(snums)
  if(snums[0][0] == 0 and len(snums) == 1):
    print("Yes")
  elif(snums[0][0] == 0 and len(snums) == 2 and snums[0][1]*2 == snums[1][1] ):
    print("Yes")
  elif(snums[0][0] != 0 and len(snums) == 3 
       and snums[0][1] == snums[1][1] == snums[2][1] ):
    print("Yes")
  else:
    print("No")