#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e9;
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    mp[a]++;
  }
  bool ans = true;
  if (mp.size() == 3) {
    for (auto p : mp) {
      if (p.second * 3 != n) {
        ans = false;
      }
    }
  } else if (mp.size() == 2) {
    int a = mp.begin()->second;
    int b = next(mp.begin())->second;
    if (a + a != b || a != b + b) {
      ans = false;
    }
  } else if (mp.size() != 1) {
    ans = false;
  }
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
