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