#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, i, e, f, g, n, m, k, l, maxx, A[200005], B[200005],
    C[200005], t, fix[200005];
string s;
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> A[i];
    fix[A[i]]++;
  }
  for (long long i = 1; i <= n; i++) {
    if (fix[A[i]] >= 3) {
      cout << "NO";
      return 0;
    }
  }
  sort(A + 1, A + 1 + n);
  A[0] = -1;
  for (long long i = 1; i <= n; i++) {
    if (A[i] != A[i - 1]) {
      a++;
      B[a] = A[i];
    } else {
      b++;
      C[b] = A[i];
    }
  }
  reverse(C + 1, C + 1 + b);
  cout << "YES" << endl << a << endl;
  for (long long i = 1; i <= a; i++) cout << B[i] << " ";
  cout << endl << b << endl;
  for (long long i = 1; i <= b; i++) cout << C[i] << " ";
}
