#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  if (x == 0) return y;
  return gcd(y % x, x);
}
long long powM(long long x, long long y, long long m) {
  long long ans = 1, r = 1;
  x = x % m;
  while (r > 0 && r <= y) {
    if (r & y) {
      ans = ans * x;
      ans = ans % m;
    }
    r = r << 1;
    x = x * x;
    x = x % m;
  }
  return ans;
}
long long countbits(long long n) {
  long long cot = 0;
  while (n) {
    cot++;
    n >>= 1;
  }
  return cot;
}
long long comb2(long long n) { return n * (n - 1) / 2; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long a[200000];
  map<int, int> m;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  sort(a, a + n);
  long long co3 = 1, e = 1, ma = 0;
  for (auto i : m) {
    if (i.second > 2) {
      e = 0;
    }
  }
  if (ma > 2) e = 0;
  if (e == 0) {
    cout << "NO" << endl;
  } else {
    if (n == 1) {
      cout << "YES" << endl;
      cout << 0 << endl;
      cout << endl;
      cout << 1 << endl;
      cout << a[0];
    } else {
      long long b[n], c[n], c1 = 0, c2 = 0;
      for (long long i = 0; i < n; i++) {
        if (a[i] == a[i + 1]) {
          b[c1] = a[i];
          c1++;
          c[c2] = a[i + 1];
          c2++;
          i++;
        } else {
          b[c1] = a[i];
          c1++;
        }
      }
      cout << "YES" << endl;
      cout << c1 << endl;
      for (long long i = 0; i < c1; i++) {
        cout << b[i] << " ";
      }
      cout << endl;
      cout << c2 << endl;
      for (long long i = c2 - 1; i >= 0; i--) {
        cout << c[i] << " ";
      }
    }
  }
  return 0;
}
