#include <bits/stdc++.h>
using namespace std;
static const long long MOD = 1e9 + 7;
static const long long INF = 1e25;
static const int MAX = 4;
static const long long MAX_N = 100001;
static const long long MAX_M = 100001;
long long a[100000];
int main() {
  long long n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    a[i] = x;
  }
  bool ok = true;
  for (int i = 0; i < n; i++) ok &= (a[i] == 0);
  if (ok) {
    cout << "Yes" << endl;
    return 0;
  }
  map<long long, long long> m;
  for (int i = 0; i < n; i++) {
    m[a[i]]++;
  }
  if (m.size() > 3) {
    cout << "No" << endl;
    return 0;
  } else if (m.size() == 3) {
    ok = true;
    for (map<long long, long long>::iterator it = m.begin(); it != m.end();
         it++) {
      ok &= (it->second == n / 3);
    }
    if (ok) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (m.size() == 2) {
    if (m[0] == n / 3) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
