#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long arr[n];
  map<long long, long long> m;
  for (long i = 0; i < n; i++) {
    cin >> arr[i];
    m[arr[i]]++;
  }
  vector<long long> a;
  int flg = 0;
  vector<long long> b;
  for (auto it : m) {
    long long x = it.first;
    long long y = it.second;
    if (y > 2) {
      cout << "NO" << endl;
      flg = 1;
      break;
    }
    if (y == 2) {
      a.push_back(x);
      b.push_back(x);
    } else {
      a.push_back(x);
    }
  }
  if (flg == 0) {
    sort(a.begin(), a.end());
    sort(b.begin(), b.end(), greater<long long>());
    cout << "YES" << endl;
    cout << a.size() << endl;
    for (long long i : a) {
      cout << i << " ";
    }
    cout << endl;
    cout << b.size() << endl;
    for (long long i : b) {
      cout << i << " ";
    }
  }
}
