#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, x;
  vector<long> v, r;
  bool deci = true;
  multiset<long> s;
  multiset<long>::iterator it;
  cin >> n;
  for (long i = 0; i < n; i++) {
    cin >> x;
    s.insert(x);
  }
  long cont = 0;
  for (it = s.begin(); it != s.end(); ++it) {
    long aux = s.count(*it);
    if (aux > 2) {
      cout << "NO" << endl;
      return 0;
    }
    if (cont % 2 == 0)
      v.push_back(*it);
    else
      r.push_back(*it);
    cont++;
  }
  cout << "YES" << endl;
  cout << v.size() << endl;
  for (long i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
  reverse(r.begin(), r.end());
  cout << r.size() << endl;
  for (long i = 0; i < r.size(); i++) cout << r[i] << " ";
  cout << endl;
  return 0;
}
