#include <bits/stdc++.h>
using namespace std;
int n;
int a[200000];
int b1 = 0;
int b2 = 0;
int c1[200000];
int c2[200000];
bool cmp(int a, int b) { return a > b; }
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  c1[b1++] = a[0];
  int cnt = 0;
  bool r = true;
  for (int i = 1; i < n; i++) {
    if (a[i] == a[i - 1]) {
      cnt++;
      c2[b2++] = a[i];
    } else {
      cnt = 0;
      c1[b1++] = a[i];
    }
    if (cnt >= 2) {
      r = false;
      break;
    }
  }
  if (r) {
    sort(c2, c2 + b2, cmp);
    cout << "YES" << endl << b1 << endl;
    for (int i = 0; i < b1; i++) {
      cout << c1[i] << " ";
    }
    cout << endl << b2 << endl;
    for (int i = 0; i < b2; i++) {
      cout << c2[i] << " ";
      ;
    }
  } else {
    cout << "NO";
  }
  return 0;
}
