#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
int main() {
  int N;
  cin >> N;
  map<int, int> cnt;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  if (cnt.size() == 1) {
    if (cnt[0] == N)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (cnt.size() == 2) {
    if (N % 3 == 0 && cnt[0] == N / 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (cnt.size() == 3) {
    if (N % 3 == 0 && cnt[a[0]] == N / 3 && cnt[a[1]] == N / 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    cout << "No" << endl;
  }
}
