#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n, a;
  bool ans = false;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < (int)(n); i++) {
    cin >> a;
    mp[a]++;
  }
  auto itr = mp.begin();
  pair<int, int> p;
  if (mp[0] == n) ans = true;
  if (n % 3 == 0 && mp[0] == (n / 3) && (p = *(++itr)).second == (n * 2 / 3))
    ans = true;
  if (n % 3 == 0 && ((p = *(itr)).second == n / 3) &&
      (p = *(itr)).second % n / 3 == 0) {
    if ((p = *(++itr)).second == n / 3 && (p = *(itr)).second % n / 3 == 0) {
      if ((p = *(++itr)).second == n / 3 && (p = *(itr)).second % n / 3 == 0)
        ans = true;
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
