#include <bits/stdc++.h>
using namespace std;
const long long INF = INT_MAX;
const long long LINF = LLONG_MAX;
const long long MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};
long long gcd(long long a, long long b) {
  long long r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
long long power(long long x, long long n, long long mod = MOD) {
  long long ret = 1;
  while (n > 0) {
    if (n & 1) {
      (ret *= x) %= mod;
    }
    (x *= x) %= mod;
    n >>= 1;
  }
  return ret;
}
vector<long long> make_power(int n, long long base) {
  long long num = 1;
  vector<long long> ret;
  for (int i = 0; i <= n; ++i) {
    ret.push_back(num);
    num *= base;
  }
  return ret;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> a(n);
  set<long long> num;
  bool allZero = true;
  bool hasZero = false;
  for (int i = (0); i < (n); i++) {
    cin >> a[i];
    num.insert(a[i]);
    if (a[i] != 0) {
      allZero = false;
    } else {
      hasZero = true;
    }
  }
  map<long long, long long> mapping;
  if (allZero) {
    cout << "Yes" << endl;
    return 0;
  } else if (hasZero && n % 3 == 0 && num.size() == 2) {
    for (auto itr = num.begin(); itr != num.end(); ++itr) {
      mapping.insert(make_pair(*itr, 0));
    }
    for (int i = (0); i < (n); i++) {
      auto t = mapping.at(a[i]);
      mapping.erase(a[i]);
      mapping.insert(make_pair(a[i], t + 1));
    }
    int k = 0;
    long long cnt[2] = {0, 0};
    long long nums[2] = {-1, -1};
    for (auto itr = num.begin(); itr != num.end(); ++itr) {
      cnt[k] = mapping.at(*itr);
      nums[k] = *itr;
      k++;
    }
    if ((nums[1] == 0 && cnt[0] == 2 * cnt[1]) ||
        (cnt[0] * 2 == cnt[1] && nums[0] == 0)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (!hasZero && n % 3 == 0 && num.size() == 3) {
    for (auto itr = num.begin(); itr != num.end(); ++itr) {
      mapping.insert(make_pair(*itr, 0));
    }
    for (int i = (0); i < (n); i++) {
      auto t = mapping.at(a[i]);
      mapping.erase(a[i]);
      mapping.insert(make_pair(a[i], t + 1));
    }
    int k = 0;
    long long cnt[3] = {0, 0, 0};
    for (auto itr = num.begin(); itr != num.end(); ++itr) {
      cnt[k] = mapping.at(*itr);
      k++;
    }
    if (cnt[0] == cnt[1] && cnt[1] == cnt[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
