#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, flag = 1, m3 = 0;
  cin >> n;
  vector<int> ar(n), c(200001, 0);
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    c[ar[i]]++;
    if (c[ar[i]] > 1) flag = 0;
    if (c[ar[i]] > 2) m3 = 1;
  }
  if (m3 == 1)
    cout << "NO";
  else if (flag == 1) {
    cout << "YES"
         << "\n";
    cout << n << "\n";
    for (int i = 0; i < 200001; i++)
      if (c[i] == 1) cout << i << " ";
    cout << "\n";
    cout << 0 << "\n";
  } else {
    cout << "YES"
         << "\n";
    vector<int> inc, dec;
    for (int i = 0; i < 200001; i++) {
      if (c[i] >= 1) {
        inc.push_back(i);
      }
      if (c[i] == 2) {
        dec.push_back(i);
      }
    }
    cout << inc.size() << "\n";
    if (inc.size() > 0)
      for (int i = 0; i < inc.size(); i++) {
        cout << inc[i] << " ";
      }
    cout << "\n";
    cout << dec.size() << "\n";
    if (dec.size() > 0)
      for (int i = dec.size() - 1; i >= 0; i--) {
        cout << dec[i] << " ";
      }
    cout << "\n";
  }
}
