#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> seq(n);
  for (int i = 0; i < n; i++) {
    cin >> seq[i];
  }
  sort(seq.begin(), seq.end());
  vector<int> inc, dec;
  bool possible = true;
  for (int i = 0; i < n; i++) {
    if (i == 0 || inc.back() != seq[i]) {
      inc.push_back(seq[i]);
    } else if (dec.size() == 0 || dec.back() != seq[i]) {
      dec.push_back(seq[i]);
    } else {
      possible = false;
      break;
    }
  }
  if (!possible) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    cout << inc.size() << endl;
    for (int i = 0; i < inc.size(); i++) {
      if (i > 0) {
        cout << " ";
      }
      cout << inc[i];
    }
    cout << endl;
    cout << dec.size() << endl;
    for (int i = dec.size() - 1; i >= 0; i--) {
      if (i < dec.size() - 1) {
        cout << " ";
      }
      cout << dec[i];
    }
    cout << endl;
  }
  return 0;
}
