#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int mark[n], z = 0;
  vector<int> v;
  v.push_back(a[0]);
  int c = 0, chk = -1;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] != a[i + 1]) {
      v.push_back(a[i + 1]);
      chk = max(chk, c + 1);
      c = 0;
    } else {
      mark[z] = i;
      z++;
      c++;
    }
  }
  if (chk > 2) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  cout << v.size() << '\n';
  for (auto i : v) cout << i << " ";
  cout << '\n';
  cout << z << '\n';
  for (int i = z - 1; i >= 0; i--) {
    cout << a[mark[i]] << " ";
  }
}
