#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a, b[200005] = {0}, ff = 0;
  vector<int> x, y;
  for (int i = 0; i < n; i++) {
    cin >> a;
    b[a]++;
    if (b[a] == 1) {
      x.push_back(a);
    }
    if (b[a] == 2) y.push_back(a);
    if (b[a] > 2) ff = 1;
  }
  if (ff == 0) {
    cout << "YES\n";
    sort(x.begin(), x.end());
    sort(y.begin(), y.end());
    cout << x.size() << "\n";
    for (int i = 0; i < x.size(); i++) cout << x[i] << " ";
    cout << "\n" << y.size() << "\n";
    for (int i = y.size() - 1; i >= 0; i--) cout << y[i] << " ";
  } else {
    cout << "NO\n";
  }
}
