#include <bits/stdc++.h>
using namespace std;
void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
int main() {
  init();
  int n;
  cin >> n;
  map<int, int> mp;
  int tmp;
  for (int i = 0; i < (int)n; i++) {
    cin >> tmp;
    mp[tmp]++;
  }
  if (mp.size() == 1) {
    if (mp.count(0) > 0 && mp[0] == n) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (n % 3 == 0 && mp.size() == 2) {
    if (mp.count(0) > 0 && mp[0] == n / 3) {
      auto itr = mp.begin();
      itr++;
      if (itr->second == 2 * (n / 3)) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  } else if (n % 3 == 0 && mp.size() == 3) {
    bool ok = true;
    for (auto itr = mp.begin(); itr != mp.end(); itr++) {
      if (!itr->second == n / 3) {
        ok = false;
        break;
      }
    }
    if (ok) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
