#include <bits/stdc++.h>
using namespace std;
long long po(long long x, long long y) {
  if (y == 0)
    return 1;
  else
    return x * po(x, y - 1);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  map<long long, long long> m;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
    if (m[a[i]] == 3) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  vector<long long> fir, sec;
  for (auto it : m) {
    if (it.second == 2) {
      sec.push_back(it.first);
    }
    fir.push_back(it.first);
  }
  sort(fir.begin(), fir.end());
  sort(sec.begin(), sec.end());
  reverse(sec.begin(), sec.end());
  cout << fir.size() << "\n";
  for (auto it : fir) {
    cout << it << " ";
  }
  cout << "\n" << sec.size() << "\n";
  for (auto it : sec) {
    cout << it << " ";
  }
  return 0;
}
