#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a = 0, ans = 0, c = 0;
  vector<int> v, va, vb;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  vb.push_back(v[0]);
  for (int i = 1; i < v.size(); i++) {
    if (v[i] == v[i - 1]) {
      ans++;
      va.push_back(v[i]);
    } else {
      ans = 0;
      vb.push_back(v[i]);
    }
    c = max(c, ans);
  }
  if (c > 1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    cout << va.size() << endl;
    for (int i = 0; i < va.size(); i++) cout << va[i] << " ";
    cout << endl;
    sort(vb.rbegin(), vb.rend());
    cout << vb.size() << endl;
    for (int i = 0; i < vb.size(); i++) cout << vb[i] << " ";
    cout << endl;
  }
}
