#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<ll, ll>;
using graph = vector<vector<ll>>;
const long long inf = 2147483647;
const ll INF = 9223372036854775807;
signed main() {
  map<long long, long long> m{};
  long long n;
  cin >> n;
  for (ll i = 0; i < n; i++) {
    long long t;
    cin >> t;
    m[t]++;
  }
  long long s = m.size();
  cout << s << "\n";
  if (s == 3 && n % 3 == 0) {
    long long t = n / 3;
    for (auto i : m)
      if (i.second != t) {
        cout << "No"
             << "\n";
        return 0;
      }
    cout << "Yes"
         << "\n";
    return 0;
  }
  if (s > 3) {
    cout << "No"
         << "\n";
    return 0;
  }
  if (m[0] == n && s == 1) {
    cout << "Yes"
         << "\n";
    return 0;
  }
  if (s == 2 && n % 3 == 0 && m[0] == n / 3) {
    cout << "Yes"
         << "\n";
    return 0;
  }
  cout << "No"
       << "\n";
  return 0;
}
