#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  vector<long long int> v;
  long long int haha = 0;
  map<long long int, long long int> mymap;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    haha += x;
    v.push_back(x);
    mymap[x]++;
  }
  bool ok = 0;
  for (auto it : mymap) {
    if (it.second >= 3) {
      ok = 1;
    }
  }
  if (ok) {
    cout << "NO" << endl;
  } else {
    vector<long long int> mag, pre;
    long long int size = v.size();
    for (long long int i = 0; i < size; i++) {
      if (mymap[v[i]] == 2) {
        mag.push_back(v[i]);
        mymap[v[i]]--;
      } else if (mymap[v[i]] == 1) {
        pre.push_back(v[i]);
      }
    }
    long long int size1 = pre.size();
    long long int size2 = mag.size();
    sort(mag.begin(), mag.end());
    sort(pre.begin(), pre.end());
    cout << "Yes" << endl;
    reverse(mag.begin(), mag.end());
    cout << size1 << endl;
    for (long long int i = 0; i < size1; i++) {
      cout << pre[i] << " ";
    }
    cout << endl;
    cout << size2 << endl;
    for (long long int i = 0; i < size2; i++) {
      cout << mag[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
