#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n];
  set<long long> inc;
  vector<long long> dec;
  map<long long, long long> mp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  bool f = 1;
  ;
  for (int i = 0; i < n; i++) {
    if (mp[a[i]] > 2) {
      f = 0;
    }
  }
  if (!f) {
    cout << "NO" << endl;
  } else {
    inc.insert(a[0]);
    for (int i = 1; i < n; i++) {
      if (inc.find(a[i]) == inc.end()) {
        inc.insert(a[i]);
      } else
        dec.push_back(a[i]);
    }
    cout << "YES" << endl;
    cout << inc.size() << endl;
    if (inc.size() == 0)
      cout << endl;
    else {
      for (auto s : inc) cout << s << " ";
      cout << endl;
    }
    cout << dec.size() << endl;
    if (dec.size() == 0)
      cout << endl;
    else {
      sort(dec.begin(), dec.end(), greater<long long>());
      for (auto s : dec) {
        cout << s << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
