#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N;
  cin >> N;
  map<long long, long long> kazu;
  long long A;
  for (long long i = 0; i < N; i++) {
    cin >> A;
    if (kazu.count(A)) {
      kazu.at(A)++;
      if (kazu.at(A) > 2) {
        cout << "NO" << endl;
        return 0;
      }
    } else
      kazu[A] = 1;
  }
  vector<long long> heru;
  vector<long long> zouka;
  for (auto p : kazu) {
    heru.push_back(p.first);
    if (p.second > 1) zouka.push_back(p.first);
  }
  cout << "YES" << endl;
  cout << zouka.size() << endl;
  for (long long i = 0; i < zouka.size(); i++) cout << zouka.at(i) << " ";
  cout << endl;
  reverse(heru.begin(), heru.end());
  cout << heru.size() << endl;
  for (long long i = 0; i < heru.size(); i++) cout << heru.at(i) << " ";
  cout << endl;
}
