#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, f = 0;
  unordered_map<int, int> um;
  unordered_map<int, int>::iterator it;
  vector<int> vf, vs;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int k;
    cin >> k;
    it = um.find(k);
    if (it == um.end()) {
      um[k] = 1;
      vf.push_back(k);
    } else {
      um[k]++;
      if (um[k] < 3)
        vs.push_back(k);
      else
        f = 1;
    }
  }
  if (f == 1)
    cout << "NO" << endl;
  else {
    sort(vf.begin(), vf.end());
    sort(vs.begin(), vs.end(), greater<int>());
    cout << "YES" << endl;
    cout << vf.size() << endl;
    if (vf.size() > 0) {
      for (int i = 0; i < vf.size() - 1; i++) cout << vf[i] << " ";
      if (vf.size() >= 1) cout << vf[vf.size() - 1] << endl;
    }
    cout << vs.size() << endl;
    if (vs.size() > 0) {
      for (int i = 0; i < vs.size() - 1; i++) cout << vs[i] << " ";
      if (vs.size() >= 1) cout << vs[vs.size() - 1] << endl;
    }
  }
}
