#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[112345];
  map<int, int> mp;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (mp.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  int b = -1;
  for (auto i : mp) {
    if (b == -1)
      b = i.second;
    else {
      if (b != i.second) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
