#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < int(n); i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  vector<int> i, d;
  unordered_map<int, int> m;
  set<int> s;
  bool f = 0;
  for (int i = 0; i < int(n); i++) {
    m[v[i]]++, s.insert(v[i]);
    if (m[v[i]] > 2) f = 1;
  }
  set<int>::iterator it;
  for (it = s.begin(); it != s.end(); it++) {
    if (m[*it] > 1) {
      i.push_back(*it), d.push_back(*it);
      m[*it] -= 2;
    } else {
      i.push_back(*it);
      m[*it]--;
    }
  }
  sort(i.begin(), i.end()), sort(d.begin(), d.end(), greater<int>());
  if (f) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    cout << i.size() << endl;
    for (auto j : i) cout << j << " ";
    cout << endl;
    cout << d.size() << endl;
    for (auto j : d) cout << j << " ";
    cout << endl;
  }
}
