#include <bits/stdc++.h>
using namespace std;
long long int ar[100005];
map<long long int, long long int> mp;
int32_t main() {
  long long int n;
  cin >> n;
  for (long long int i = 1; i <= n; i++) {
    cin >> ar[i];
    mp[ar[i]]++;
  }
  sort(ar + 1, ar + n + 1);
  if (mp.size() == 3 && ((n % 3) == 0)) {
    if (mp[ar[1]] == mp[ar[n]] && mp[ar[1]] == mp[ar[(n + 1) / 2]]) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
}
