#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5, mod = 1e9 + 7, inf = 1e9 + 7;
long long n;
long long a[N];
map<long long, long long> mpp;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    if (mpp.find(a[i]) == mpp.end()) {
      mpp[a[i]] = 1;
    } else {
      mpp[a[i]]++;
    }
  }
  if (mpp.size() == 3 && n % 3 == 0) {
    auto itr = mpp.begin();
    if ((itr->second == (++itr)->second) && (itr->second == (++itr)->second)) {
      cout << "Yes";
      return 0;
    }
  }
  if (mpp.size() == 2 && n % 3 == 0) {
    auto itr = mpp.begin();
    if (itr->first == 0 && itr->second == n / 3) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
}
