#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  set<int> unique;
  multiset<int> camel;
  int c;
  for (int i = 0; i < N; i++) {
    cin >> c;
    camel.insert(c);
    unique.insert(c);
  }
  int tempcount;
  tempcount = *unique.begin();
  if (unique.size() == 3) {
    for (int element : unique) {
      if (camel.count(element) != tempcount) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  } else {
    cout << "No" << endl;
    return 0;
  }
}
