#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n;
  int v[n];
  map<int, int> m;
  vector<int> mame;
  vector<int> mema;
  bool b = true;
  for (int i = 0; i < n; i++) {
    cin >> a;
    v[i] = a;
    if (m[a] == 2) {
      b = false;
    } else {
      m[a]++;
    }
  }
  if (!b) {
    cout << "NO" << endl;
  } else {
    sort(v, v + n);
    reverse(v, v + n);
    for (int i = 0; i < n; i += 2) {
      mame.push_back(v[i]);
      if (i + 1 < n) {
        mema.push_back(v[i + 1]);
      }
    }
    reverse(mema.begin(), mema.end());
    cout << "YES" << endl;
    cout << mema.size() << endl;
    for (int i = 0; i < mema.size(); i++) {
      cout << mema[i] << " ";
    }
    cout << endl;
    cout << mame.size() << endl;
    for (int i = 0; i < mame.size(); i++) {
      cout << mame[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
