#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  map<int, int> data;
  for (int i = 0; i < N; i++) data[a[i]]++;
  bool can = false;
  if (data.size() == 1) {
    if (data.count(0)) can = true;
  } else if (data.size() == 2) {
    if (data.count(0)) {
      int a0, a1;
      for (auto i : data) {
        if (i.first == 0)
          a0 = i.second;
        else
          a1 = i.second;
      }
      if (2 * a0 == a1) can = true;
    }
  } else if (data.size() == 3) {
    vector<int> b(3), c(3);
    int j = 0;
    for (auto i : data) {
      b[j] = i.first;
      c[j] = i.second;
      j++;
    }
    if (b[0] + b[1] == b[2] && c[0] == c[1] && c[1] == c[2]) can = true;
  }
  if (can)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
