#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<string> bit;
string toBin(ll n) {
  if (n == 1)
    return "1";
  else if (n == 0)
    return "0";
  return toBin(n / 2) + to_string(n % 2);
}
int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort((a).begin(), (a).end());
  if (n % 3 != 0) {
    cout << "No";
    return 0;
  }
  vector<ll> c;
  ll sum[3] = {0};
  c.push_back(a[0]);
  for (int i = 1; i < n; i++) {
    while (a[i] == a[i - 1]) {
      i++;
      sum[c.size() - 1]++;
    }
    c.push_back(a[i]);
    if (c.size() > 3) {
      cout << "No";
      return 0;
    }
  }
  if (sum[0] == sum[1] && sum[2] == sum[1])
    cout << "Yes";
  else {
    cout << "No";
  }
  return 0;
}
