#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  map<long long, long long> mp;
  vector<long long> val;
  for (int i = 0; i < N; i++) {
    long long a;
    cin >> a;
    if (mp.count(a) == 0) {
      val.push_back(a);
    }
    mp[a]++;
  }
  sort(val.begin(), val.end());
  bool is = false;
  if ((int)val.size() == 1) {
    if (mp[0] == N) is = true;
  }
  if (N % 3 == 0) {
    long long v = (int)val.size();
    if (v == 3) {
      if ((mp[val[0]] == N / 3) && (mp[val[0]] == mp[val[1]]) &&
          (mp[val[1]] == mp[val[2]]))
        is = true;
    } else if (v == 2) {
      if ((val[0] == 0) && (mp[val[0]] == N / 3) && (mp[val[1]] = 2 * N / 3))
        is = true;
    } else if (v == 1 && mp[0] == N)
      is = true;
    else
      is = false;
  }
  if (is)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
