#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int a[n];
  int f[200002] = {0};
  vector<long long int> dec;
  vector<long long int> inc;
  long long int li = 0, ld = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    f[a[i]]++;
    if (f[a[i]] > 2) {
      cout << "NO";
      return 0;
    }
    if (f[a[i]] == 1) {
      inc.push_back(a[i]);
      li++;
    } else if (f[a[i]] == 2) {
      ld++;
      dec.push_back(a[i]);
    }
  }
  sort(inc.begin(), inc.end());
  sort(dec.begin(), dec.end(), greater<long long int>());
  cout << "YES\n" << li << "\n";
  for (auto j = inc.begin(); j != inc.end(); j++) {
    cout << *j << " ";
  }
  cout << "\n" << ld << "\n";
  for (auto j = dec.begin(); j != dec.end(); j++) {
    cout << *j << " ";
  }
}
