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

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