#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long INF = (1LL << 31) - 1;
const double pi = acos(-1);
int main() {
  int n;
  cin >> n;
  map<long long, int> mp;
  for (long long i = 0; i < (n); i++) {
    long long a;
    cin >> a;
    mp[a]++;
  }
  bool ok = false;
  if (mp[0] == n) {
    ok = true;
  } else {
    long long sum = 0;
    for (auto p : mp) {
      if (p.second) sum++;
    }
    if (n % 3 == 0 && sum == 2) {
      if (mp[0] == n / 3) ok = true;
    }
    if (n % 3 == 0 && sum == 3) {
      bool can = true;
      for (auto t : mp) {
        if (t.second && t.second != n / 3) can = false;
      }
      if (can) ok = true;
    }
  }
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
