#include <bits/stdc++.h>
using namespace std;
struct Interval {
  int start, end;
};
bool compare(Interval i1, Interval i2) { return (i1.start < i2.start); }
long long int coun[200005] = {0};
int main() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < (n); ++i) {
    cin >> a[i];
    coun[a[i]]++;
  }
  sort(a, a + n);
  long long int c = 0;
  for (long long int i = 0; i < (200005); ++i) {
    if (coun[i] > 2) {
      c = 1;
      break;
    }
  }
  if (c == 1)
    cout << "NO";
  else {
    vector<long long int> inc, dec;
    inc.push_back(a[0]);
    for (int i = 1; i <= (n - 1); ++i) {
      if (a[i] == a[i - 1])
        dec.push_back(a[i]);
      else
        inc.push_back(a[i]);
    }
    sort(dec.begin(), dec.end(), greater<long long int>());
    cout << "YES" << endl;
    cout << inc.size() << endl;
    for (long long int i = 0; i < (inc.size()); ++i) cout << inc[i] << " ";
    cout << endl;
    cout << dec.size() << endl;
    for (long long int i = 0; i < (dec.size()); ++i) cout << dec[i] << " ";
  }
  return 0;
}
