#include <bits/stdc++.h>
using namespace std;
long long int pow1(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b & 1) {
      ans = ans * a;
    }
    a = a * a;
    b = b >> 1;
  }
  return ans;
}
int main() {
  int n, i, j, x;
  cin >> n;
  map<int, int> v;
  int first = 0;
  for (i = 0; i < n; i++) {
    cin >> x;
    if (x != 0) first = 1;
    v[x]++;
  }
  if (!first) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (v[0] != 0) {
    map<int, int>::iterator it = v.begin();
    for (; it != v.end(); it++) {
      if ((it->first) != 0 && (it->second) != (2 * n) / 3 &&
          v[0] != (n - (2 * n) / 3)) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
  } else {
    map<int, int>::iterator it = v.begin();
    for (; it != v.end(); it++) {
      if ((it->second) != 0 && (it->second) != (n / 3)) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
  }
  return 0;
}
