#include <bits/stdc++.h>
using namespace std;
const long long N = 10010;
const long long INF = 0x3f3f3f3f;
const long long MOD = 1e9 + 7;
int solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  if (a[n - 1] == 0) return 1;
  if (n % 3 != 0) return 0;
  map<int, int> count;
  for (int i = 0; i < n; ++i) {
    count[a[i]]++;
  }
  if (count.size() == 3) {
    vector<int> c(3);
    int i = 0;
    for (auto x : count) {
      c[i++] = x.second;
    }
    if (c[0] == c[1] && c[1] == c[2]) return 1;
  }
  if (count.size() == 2) {
    vector<int> c(2);
    int i = 0;
    for (auto x : count) {
      c[i++] = x.second;
    }
    if (c[0] == 2 * c[1] || c[1] == 2 * c[0]) return 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (solve() == 1)
    cout << "Yes" << '\n';
  else
    cout << "No" << '\n';
  return 0;
}
