#include <bits/stdc++.h>
using namespace std;
const long long MOD = (1e9 + 7);
const long long INF = (1e9 + 123456789);
const long long INFL = (INF * INF);
inline long long addm(long long a, long long b, long long m = MOD) {
  return ((a + b) % m);
}
inline long long subm(long long a, long long b, long long m = MOD) {
  return (((a - b) % m + m) % m);
}
inline long long mulm(long long a, long long b, long long m = MOD) {
  return ((a * b) % m);
}
long long powm(long long a, long long b, long long m = MOD) {
  long long ret = (!b) ? 1 : powm(a, b / 2);
  return (!b) ? 1 : mulm(mulm(ret, ret, m), b % 2 ? a : 1, m);
}
long long gcd(long long a, long long b) { return (!b) ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long inv(long long x, long long m = MOD) { return powm(x, m - 2, m); }
int cnt[200500];
void solve() {
  int n;
  cin >> n;
  vector<int> f, s;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    cnt[x]++;
    if (cnt[x] > 2) {
      cout << "NO"
           << "\n";
      return;
    }
    if (cnt[x] == 1)
      f.push_back(x);
    else
      s.push_back(x);
  }
  sort((f).begin(), (f).end());
  sort((s).begin(), (s).end());
  reverse((s).begin(), (s).end());
  cout << "YES"
       << "\n";
  cout << (int)(f).size() << "\n";
  for (int x : f) cout << x << " ";
  cout << "\n";
  cout << (int)(s).size() << "\n";
  for (int x : s) cout << x << " ";
  cout << "\n";
}
int main(int argc, char *argv[]) {
  cin.sync_with_stdio(0);
  cin.tie(NULL);
  solve();
  return 0;
}
