#include <bits/stdc++.h>
using namespace std;
void no() {
  cout << "No\n";
  exit(0);
}
void yes() {
  cout << "Yes\n";
  exit(0);
}
int main() {
  int n;
  cin >> n;
  map<int, int> c;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    c[x]++;
  }
  if (c.size() > 3) no();
  if (c.size() == 1) {
    if (c.begin()->first == 0)
      yes();
    else
      no();
  }
  if (c.size() == 2) {
    if (c.begin()->first == 0 && c.rbegin()->second == 2 * n / 3 && n % 3 == 0)
      yes();
    else
      no();
  }
  auto it = c.begin();
  if (n % 3 == 0 && it->second == n / 3 && next(it)->second == n / 3)
    yes();
  else
    no();
}
