#include <bits/stdc++.h>
using namespace std;
int main() {
  int prevv = -1, prev = -1, n, num;
  cin >> n;
  vector<int> inp, v;
  stack<int> s;
  for (int i = 0; i < n; i++) {
    cin >> num;
    inp.push_back(num);
  }
  sort(inp.begin(), inp.end());
  for (int x : inp) {
    if (x == prev) {
      if (x == prevv) {
        cout << "NO";
        return 0;
      } else
        s.push(x);
    } else
      v.push_back(x);
    prevv = prev;
    prev = x;
  }
  cout << "YES" << endl;
  cout << v.size() << endl;
  for (int x : v) cout << x << " ";
  cout << endl;
  cout << s.size() << endl;
  while (!s.empty()) {
    cout << s.top() << " ";
    s.pop();
  }
  return 0;
}
