a=int(input())
b=list(map(int, input().split()))
c=list(set(b))
if len(c)!=3:
  print("No")
else:  
  d=[0 for i in range(3)]
  for i in range(len(c)):
    e=c[i]
    d[i]=b.count(e)
  if d[0]==d[1]and d[0]==d[2]:
    print("Yes")
  else:
    print("No")