#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n), c;
  set<int, greater<int> > s;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  sort(a.begin(), a.end());
  int j = 0, count = 1;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == a[i + 1]) {
      count++;
      b[j] = a[i];
      j++;
    } else
      count = 1;
    if (count > 2) break;
  }
  sort(b.begin(), b.end());
  if (count > 2) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    cout << j << endl;
    for (int i = n - j; i < n; i++) cout << b[i] << " ";
    cout << "\n";
    cout << s.size() << endl;
    for (auto& it : s) cout << it << " ";
    cout << "\n";
  }
}
