#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main() {
  long long N;
  cin >> N;
  vector<long long> A(N);
  map<long long, long long> mp;
  for (long long i = 0; i < N; ++i) {
    cin >> A[i];
    mp[A[i]]++;
  }
  if (mp.size() == 3) {
    for (auto it : mp) {
      if (it.second != N / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
  } else if (mp.size() == 2) {
    bool ok = false;
    for (auto it : mp) {
      if (it.first == 0) ok = true;
      if (it.second != N / 2) {
        ok = false;
      }
    }
    if (!ok) {
      cout << "No" << endl;
      return 0;
    }
  } else if (mp.size() == 1) {
    for (auto it : mp) {
      if (it.first != 0) {
        cout << "No" << endl;
        return 0;
      }
    }
  } else {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}
