import algorithm, future, macros, math, sequtils, sets, strutils, tables

macro unpack(rhs: seq, cnt: static[int]): auto =
  let t = genSym(); result = quote do:(let `t` = `rhs`;())
  if NimMinor <= 17:
    for i in 0..<cnt: result[0][1].add(quote do:`t`[`i`])
  else:
    for i in 0..<cnt: result[1].add(quote do:`t`[`i`])

template input(T: typedesc, cnt: Natural = 1): untyped =
  let line = stdin.readLine.split(" ")
  when T is int:         line.map(parseInt).unpack(cnt)
  elif T is float:       line.map(parseFloat).unpack(cnt)
  elif T is string:      line.unpack(cnt)
  elif T is char:        line.mapIt(it[0]).unpack(cnt)
  elif T is seq[int]:    line.map(parseint)
  elif T is seq[float]:  line.map(parseFloat)
  elif T is seq[string]: line
  elif T is seq[char]:   line.mapIt(it[0])

proc `%=`(n: var int, m: int)  = n = n mod m
proc `//=`(n: var int, m: int) = n = n div m
proc `<<=`(n: var int, m: int) = n = n shl m
proc `>>=`(n: var int, m: int) = n = n shr m
proc `<?=`(n: var int, m: int) = n = min(n, m)
proc `>?=`(n: var int, m: int) = n = max(n, m)
proc newSeq2[T](n1, n2: Natural): seq[seq[T]] = newSeqWith(n1, newSeq[T](n2))
proc newSeq3[T](n1, n2, n3: Natural): seq[seq[seq[T]]] = newSeqWith(n1, newSeqWith(n2, newSeq[T](n3)))

# -------------------------------------------------- #

var N = input(int)
var A = @[0] & input(seq[int]).sorted(cmp)
var nanka = true
if N mod 3 == 0:
  var q1 = N div 3
  var q2 = (N div 3 * 2)
  #echo nanka
  for i in 1 ..< q1:
    if A[i] != A[i + 1]:
      nanka = false
  #echo nanka
  for j in q1 + 1 ..< q2:
    if A[j] != A[j + 1]:
      nanka = false
  #echo nanka
  for k in q2 + 1 ..< N:
    if A[k] != A[k + 1]:
      nanka = false
  #echo nanka
else:
  nanka = false
var all0 = true
for a in A:
  if a != 0:
    all0 = false
if nanka or all0:
  echo "Yes"
else:
  echo "No"