#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    mp[t]++;
  }
  if (mp.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 1) {
    if (mp[0] == n)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (n % 3 == 2) {
    cout << "No" << endl;
    return 0;
  }
  if (n % 3 == 0) {
    if (mp.size() == 2 && mp[0] == n / 3) {
      cout << "Yes" << endl;
      return 0;
    }
    if (mp.size() == 3) {
      for (auto& kv : mp) {
        if (kv.second != n / 3) {
          cout << "No" << endl;
          return 0;
        }
      }
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
    return 0;
  }
  if (n % 3 == 1) {
    cout << "No" << endl;
    return 0;
  }
  return 0;
}
