#include <bits/stdc++.h>
int main() {
  long long int N;
  std::cin >> N;
  std::vector<long long int> a(N);
  for (long long int i = 0; i < N; ++i) std::cin >> a[i];
  std::map<long long int, long long int> cnt;
  for (long long int i = 0; i < N; ++i) ++cnt[a[i]];
  bool ans = false;
  if (cnt.size() == 3) {
    long long int b[3];
    long long int d[3];
    long long int c = 0;
    for (auto i : cnt) {
      b[c] = i.second;
      d[c] = i.first;
      ++c;
    }
    std::sort(b, b + 3);
    if (N % 3 == 0) {
      if (b[0] == b[1] && b[1] == b[2] && b[0] == b[2]) ans = true;
    }
  }
  if (cnt.size() == 2) {
    long long int b[2];
    long long int d[2];
    long long int c = 0;
    for (auto i : cnt) {
      b[c] = i.second;
      d[c] = i.first;
      ++c;
    }
    std::sort(b, b + 2);
    std::sort(d, d + 2);
    if (N % 3 == 0) {
      if (cnt[d[1]] == cnt[d[0]] * 2 && d[0] == 0) ans = true;
    }
  }
  if (cnt.size() == 1) {
    if (cnt[0] == N) ans = true;
  }
  std::cout << (ans ? "Yes" : "No") << std::endl;
}
