#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  long long ans = 0;
  cin >> n;
  vector<int> v(n);
  bool flag = true;
  unordered_map<int, int> m;
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
    m[v[i]]++;
    if (m[v[i]] > 2) {
      flag = false;
    }
  }
  if (!flag) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    sort(v.begin(), v.end());
    set<int> s1, s2;
    for (int i = 0; i < n; ++i) {
      s1.insert(v[i]);
      if (m[v[i]] == 2) {
        s2.insert(v[i]);
      }
    }
    cout << s1.size() << endl;
    for (int it : s1) {
      cout << it << " ";
    }
    cout << endl;
    cout << s2.size() << endl;
    if (s2.size()) {
      for (auto it = --s2.end(); it != s2.begin(); it--) {
        cout << *it << " ";
      }
      cout << *s2.begin();
      cout << endl;
    }
  }
}
