#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  bool isAllZero = true;
  int zero = 0;
  for (int i = 0; i < (n); ++i) {
    isAllZero &= (a[i] == 0);
    zero += (a[i] == 0);
  }
  map<long long int, int> mp;
  for (int i = 0; i < (n); ++i) {
    mp[a[i]]++;
  }
  bool ok = true;
  if (mp.size() == 3) {
    for (auto it : mp) ok &= (it.second == n / 3);
  } else if (mp.size() == 2) {
    for (auto it : mp) ok &= (it.second == n / 3 || it.second == 2 * n / 3);
    ok &= (zero == n / 3 || zero == 2 * n / 3);
  } else {
    ok = isAllZero;
  }
  if (ok) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
