#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  int did[200001] = {0};
  bool f = true;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    did[t]++;
    if (did[t] > 2) {
      f = false;
    }
  }
  if (!f) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    vector<int> l, r;
    for (int i = 0; i < 200001; i++) {
      if (did[i] == 1) {
        l.push_back(i);
      }
      if (did[i] == 2) {
        l.push_back(i);
        r.push_back(i);
      }
    }
    cout << l.size() << endl;
    for (int i = 0; i < l.size(); i++) {
      cout << l[i] << " ";
    }
    cout << endl;
    cout << r.size() << endl;
    for (int i = r.size() - 1; i >= 0; i--) {
      cout << r[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
