#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], f[200003] = {};
  set<int> s;
  priority_queue<int> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) f[a[i]]++;
  for (int i = 0; i < 200003; i++) {
    if (f[i] > 2) {
      cout << "NO";
      return 0;
    }
  }
  for (int i = 0; i < 200003; i++) {
    if (f[i] == 2) {
      s.insert(i);
      q.push(i);
    }
    if (f[i] == 1) q.push(i);
  }
  cout << "YES" << endl;
  cout << s.size() << endl;
  if (s.size() > 0) {
    for (auto it : s) cout << it << " ";
  } else
    cout << " ";
  cout << endl;
  cout << q.size() << endl;
  if (q.size() > 0) {
    while (!q.empty()) {
      cout << q.top() << " ";
      q.pop();
    }
  } else
    cout << " ";
  cout << endl;
}
