#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int j = 0, k = 0, b[n], c[n], signal = 0;
  long long int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (a[i] == a[i + 1]) {
      b[j] = a[i];
      j++;
    } else {
      c[k] = a[i];
      k++;
    }
  }
  sort(c, c + k, greater<int>());
  if (j > 1) {
    for (int i = 0; i < j; i++) {
      if (b[i] == b[i + 1]) {
        signal = 1;
        break;
      }
    }
  }
  if (signal == 1)
    cout << "NO";
  else {
    cout << "YES"
         << "\n";
    cout << j << "\n";
    for (int i = 0; i < j; i++) cout << b[i] << " ";
    cout << "\n";
    cout << k << "\n";
    for (int i = 0; i < k; i++) cout << c[i] << " ";
  }
  return 0;
}
