#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int in[maxn], de[maxn], a[maxn];
int main() {
  memset(in, -1, sizeof in);
  memset(de, -1, sizeof de);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int cnti = 0, cntd = 0;
  in[cnti++] = a[0];
  bool flag = 1;
  for (int i = 1; i < n; i++) {
    if (a[i] == in[cnti - 1]) {
      if (cntd > 0 && a[i] == de[cntd - 1]) {
        flag = 0;
        break;
      } else {
        de[cntd++] = a[i];
      }
    } else {
      in[cnti++] = a[i];
    }
  }
  if (flag) {
    cout << "YES\n";
    cout << cnti << endl;
    for (int i = 0; i < cnti; i++) {
      cout << in[i] << " ";
    }
    cout << endl;
    cout << cntd << endl;
    for (int i = cntd - 1; i >= 0; i--) {
      cout << de[i] << " ";
    }
    cout << endl;
  } else
    cout << "NO\n";
}
