import sys, collections
readline=sys.stdin.buffer.readline

N=int(readline())
a=list(map(int,readline().split()))
#print(a)

if len(set(a))==1 and a[0]==0:
  print("Yes")
  exit()

if len(a)%3!=0:
  print("No")
else:
  if len(set(a))==2:
    aa=collections.Counter(a).items()
    aa=list(aa)
    aa.sort()
    #print(aa)
    if aa[0][0]==0 and aa[0][1]*2==aa[1][1]:
      print("Yes")
    else:
      print("No")
  elif len(set(a))==3:
    aa=collections.Counter(a).items()
    aa=list(aa)
    #print("aa1:",aa)
    if aa[0][1]==aa[1][1]==aa[2][1]:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
  #3の倍数でa,b,c