#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int kind = 0;
  map<long long, long long> list;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (list.count(a))
      list[a] += 1;
    else {
      list[a] = 1;
      kind++;
    }
  }
  if (kind > 3)
    cout << "No" << endl;
  else if (kind == 3) {
    auto iter = list.begin();
    long long a1 = iter->first, a1_n = iter->second;
    iter++;
    long long a2 = iter->first, a2_n = iter->second;
    iter++;
    long long a3 = iter->first, a3_n = iter->second;
    cout << "No" << endl;
  } else if (kind == 2) {
    auto iter = list.begin();
    long long a1 = iter->first, a1_n = iter->second;
    iter++;
    long long a2 = iter->first, a2_n = iter->second;
    if (a1 == 0) {
      if (a1_n * 2 == a2_n)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  } else if (kind == 1) {
    if (list.count(0))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
