#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    vector<int> v;
    for (int i = 0; i < n; i++) {
      int r;
      cin >> r;
      v.push_back(r);
    }
    vector<int> cr;
    vector<int> dr;
    int sw = 0;
    sort(v.begin(), v.end());
    for (int i = 0; i < n; i++) {
      if (i % 2 == 0)
        cr.push_back(v[i]);
      else
        dr.push_back(v[i]);
    }
    sort(cr.begin(), cr.end());
    for (int i = 1; i < cr.size(); i++) {
      if (cr[i] == cr[i - 1]) sw = 1;
    }
    sort(dr.begin(), dr.end());
    for (int i = 1; i < dr.size(); i++) {
      if (dr[i] == dr[i - 1]) sw = 1;
    }
    if (sw == 1)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      cout << cr.size() << endl;
      for (int i = 0; i < cr.size(); i++) cout << cr[i] << " ";
      cout << endl;
      cout << dr.size() << endl;
      reverse(dr.begin(), dr.end());
      for (int i = 0; i < dr.size(); i++) {
        cout << dr[i] << " ";
      }
      cout << endl;
    }
  }
}
