N = int(input())
num_arr = sorted([int(i) for i in input().split()])
u_arr = list(set(num_arr))


if 0 in num_arr:
  if u_arr == 0:
    print("Yes")
  else:
    N%3 != 0:
      print("No")
    else:
      if len(u_arr) != 2:
        print("No")
      else:
        if u_arr == [0]*(N//3) + [u_arr[1]]*(N//3)*2:
          print("Yes")
        else:
          print("No")

    
else:
  if N%3 != 0:
    print("No")
  else:
    if num_arr == u_arr*(N//3):
      print("Yes")
    else:
      print("No")
      