#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  int n;
  unordered_map<int, int> m;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    m[x]++;
  }
  if (m.size() == 1) {
    if (m.find(0) == m.end())
      cout << "No\n";
    else
      cout << "Yes\n";
  } else if (m.size() == 2) {
    if (m.find(0) == m.end())
      cout << "No\n";
    else {
      int zero = m[0];
      for (auto &p : m) {
        if (p.first != 0) {
          if (p.second != 2 * zero)
            cout << "No\n";
          else
            cout << "Yes\n";
        }
      }
    }
  } else if (m.size() == 3) {
    int k = -1;
    bool possible = true;
    for (auto &p : m) {
      if (k == -1) k = p.second;
      if (p.second != k) possible = false;
    }
    cout << (possible ? "Yes\n" : "No\n");
  } else
    cout << "No\n";
  return 0;
}
