#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  map<int, int> m;
  int ma = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    m[x]++;
    ma = max(ma, m[x]);
  }
  if (ma >= 3) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  vector<int> a, b;
  for (auto it = m.begin(); it != m.end(); it++) {
    a.push_back(it->first);
    m[it->first]--;
  }
  for (auto it = m.begin(); it != m.end(); it++) {
    if (it->second > 0) b.push_back(it->first);
  }
  cout << a.size() << "\n";
  for (int i = 0; i < a.size(); i++) {
    cout << a[i] << " ";
  }
  cout << "\n";
  reverse(b.begin(), b.end());
  cout << b.size() << "\n";
  for (int i = 0; i < b.size(); i++) {
    cout << b[i] << " ";
  }
}
