#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  vector<int> b0, b1;
  int aa = a[0];
  int c = 1;
  for (int i = 1; i < n; i++) {
    if (a[i - 1] == a[i]) {
      c++;
    } else {
      if (c > 2) {
        cout << "NO";
        return 0;
      } else if (c == 2) {
        b0.push_back(aa);
        b1.push_back(aa);
      } else {
        b1.push_back(aa);
      }
      c = 1;
      aa = a[i];
    }
  }
  if (c > 2) {
    cout << "NO";
    return 0;
  } else if (c == 2) {
    b0.push_back(aa);
    b1.push_back(aa);
  } else {
    b1.push_back(aa);
  }
  cout << "YES" << endl;
  sort(b0.begin(), b0.end());
  sort(b1.begin(), b1.end());
  cout << b0.size() << endl;
  for (int i = 0; i < b0.size(); i++) {
    cout << b0[i] << ' ';
  }
  cout << endl << b1.size() << endl;
  for (int i = 0; i < b1.size(); i++) {
    cout << b1[b1.size() - i - 1] << ' ';
  }
  return 0;
}
