#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long c = gcd(a, b);
  return ((a / c) * (b / c) * c);
}
const long long INF = long long(1e16) + long long(7);
const long long MOD = 1000000007LL;
long long keta(long long a) {
  long long r = 0;
  while (a) {
    a /= 10;
    r++;
  }
  return r;
}
int main() {
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (auto &&x : a) cin >> x;
  map<long long, long long> ma;
  for (auto x : a) {
    ma[x]++;
  }
  if (ma[0] == N) {
    cout << "Yes" << endl;
  } else if (N % 3 != 0) {
    cout << "No" << endl;
  } else if (ma.size() == 2 && ma[0] * 3 == N) {
    cout << "Yes" << endl;
  } else {
    bool ok = true;
    for (auto x : ma) {
      if (x.first == 0 && x.second == 0) continue;
      if (x.second * 3 != N) ok = false;
    }
    cout << (ok ? "Yes" : "No") << endl;
  }
}
