#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, x, y, i, r;
  cin >> n;
  map<long long int, long long int> m;
  vector<long long int> v, v1;
  for (i = 0; i < n; i++) {
    cin >> x;
    m[x]++;
  }
  map<long long int, long long int>::iterator it;
  for (it = m.begin(); it != m.end(); it++) {
    if (it->second > 2) {
      cout << "NO";
      return 0;
    }
    if (it->second == 2) {
      v.push_back(it->first);
      v1.push_back(it->first);
    } else if (it->second == 1) {
      v1.push_back(it->first);
    }
  }
  cout << "YES\n";
  sort(v.begin(), v.end());
  cout << v.size();
  cout << endl;
  ;
  if (v.size() == 0) {
    cout << endl;
    ;
  } else {
    for (i = 0; i < v.size(); i++) cout << v[i] << " ";
    cout << endl;
    ;
  }
  sort(v1.rbegin(), v1.rend());
  cout << v1.size();
  cout << endl;
  ;
  if (v1.size() == 0) cout << endl;
  ;
  for (i = 0; i < v1.size(); i++) cout << v1[i] << " ";
}
