#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  map<long long, int> mp;
  for (int i = (0); i < (n); ++i) {
    int a;
    cin >> a;
    ++mp[a];
  }
  if (mp.size() == 1 && mp.count(0)) {
    cout << "Yes\n";
    return 0;
  }
  if (n % 3 == 0) {
    if (mp.size() == 2) {
      cout << (mp.count(0) && mp[0] == n / 3 &&
                       (*mp.rbegin()).second == 2 * n / 3
                   ? "Yes\n"
                   : "No\n");
      return 0;
    }
    if (mp.size() == 3) {
      bool ok = true;
      for (auto p : mp) {
        if (p.second != n / 3) ok = false;
      }
      cout << (ok ? "Yes\n" : "No\n");
      return 0;
    }
  }
  cout << "No\n";
  return 0;
}
