#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  map<long long, int> cnt;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    cnt[a]++;
  }
  if (cnt[0] == n)
    cout << "Yes" << endl;
  else if (cnt[0] == n / 3 && cnt.size() == 2)
    cout << "Yes" << endl;
  else if (cnt.size() == 4) {
    bool yes = true;
    for (auto p : cnt) {
      if (p.first == 0) continue;
      if (p.second != n / 3) yes = false;
    }
    if (yes) cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
