#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  bool ans = false;
  cin >> n;
  int a[n];
  map<int, int> M;
  for (int i = 0; i < (n); i++) {
    cin >> a[i];
    M[a[i]]++;
  }
  int val[3];
  int i = 0;
  if (M.size() == 3) {
    for (auto itr = M.begin(); itr != M.end(); ++itr) {
      val[i] = itr->second;
      i++;
    }
    if (val[0] == val[2]) ans = true;
  } else if (M.size() == 2) {
    for (auto itr = M.begin(); itr != M.end(); ++itr) {
      val[i] = itr->second;
      i++;
    }
    if (val[0] * 2 == val[1]) ans = true;
  } else if (M.size() == 1) {
    map<int, int>::iterator iter = begin(M);
    pair<int, int> p = *iter;
    val[0] = p.first;
    if (val[0] == 0) ans = true;
  }
  (ans) ? puts("Yes") : puts("No");
  return 0;
}
