#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long INF = 1000000009;
void solve() {
  int n;
  cin >> n;
  int a[n + 10];
  bool judgeall0 = true;
  bool double2 = true;
  bool triplesame = true;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) judgeall0 = false;
  }
  sort(a, a + n);
  int p, q, r;
  p = a[0];
  q = a[n / 3];
  r = a[n - 1];
  if (p != 0) double2 = false;
  int nump = 0;
  int numq = 0;
  int numr = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] == p)
      nump++;
    else if (a[i] == q)
      numq++;
    else if (a[i] == r)
      numr++;
    else {
      double2 = false;
      triplesame = false;
    }
  }
  if (nump != numq || numq != numr) triplesame = false;
  if (nump != numr * 2 && nump * 2 != numr) double2 = false;
  if (n % 3 != 0) {
    if (!judgeall0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  } else {
    if (judgeall0 || triplesame || double2)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
