#include <bits/stdc++.h>
using namespace std;
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
int main() {
  lint n, size, ans = 0;
  cin >> n;
  vector<lint> a(n), b;
  for (int i = (0), i_end_ = (n); i < i_end_; i++) {
    cin >> a[i];
  }
  b = a;
  sort(a.begin(), a.end());
  a.erase(std::unique(a.begin(), a.end()), a.end());
  size = a.size();
  sort(a.begin(), a.end());
  lint n_count[3];
  if (size > 3) {
    {
      cout << "No"
           << "\n";
    }
    return 0;
  }
  for (int i = (0), i_end_ = (size); i < i_end_; i++) {
    n_count[i] = std::count(b.begin(), b.end(), a[i]);
  }
  if (size == 2) {
    if (n_count[1] == n / 3 && a[0] == 0) {
      cout << "Yes"
           << "\n";
    } else {
      cout << "No"
           << "\n";
    }
    return 0;
  }
  if (size == 1) {
    if (a[0] == 0) {
      cout << "Yes"
           << "\n";
    } else {
      cout << "No"
           << "\n";
    }
    return 0;
  }
  if (size == 3 && n_count[0] == n_count[1] && n_count[2] == n_count[1]) {
    cout << "Yes"
         << "\n";
    return 0;
  } else {
    cout << "No"
         << "\n";
    return 0;
  }
  cout << "No"
       << "\n";
  return 0;
}
