#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> v, fr(200001, 0);
  long long ans = 1;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    v.push_back(a);
    fr[a]++;
    if (fr[a] > 2) {
      ans = 0;
    }
  }
  if (ans) {
    sort(v.begin(), v.end());
    cout << "Yes" << endl;
    vector<long long> inc, dec;
    for (long long i = 0; i < n; i++) {
      if (i % 2) {
        inc.push_back(v[i]);
      } else {
        dec.push_back(v[i]);
      }
    }
    cout << inc.size() << endl;
    for (long long i = 0; i < inc.size(); i++) {
      cout << inc[i] << " ";
    }
    cout << endl;
    cout << dec.size() << endl;
    for (long long i = dec.size() - 1; i >= 0; i--) {
      cout << dec[i] << " ";
    }
    cout << endl;
  } else {
    cout << "NO" << endl;
  }
}
