#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  bool found = true;
  map<int, int> m;
  vector<int> v1;
  vector<int> v2;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    m[arr[i]]++;
  }
  map<int, int>::iterator it;
  for (it = m.begin(); it != m.end(); it++) {
    if (it->second > 2) {
      found = false;
      break;
    }
    if (it->second == 2) {
      v1.push_back(it->first);
      it->second = 1;
    } else if (it->second == 1) {
      v1.push_back(it->first);
      it->second = 0;
      ;
    }
  }
  map<int, int>::iterator it2;
  for (it2 = m.begin(); it2 != m.end(); it2++) {
    if (it2->second >= 2) {
      found = false;
      break;
    } else if (it2->second == 1) {
      v2.push_back(it2->first);
    }
  }
  if (found == false)
    cout << "NO" << endl;
  else {
    sort(v1.begin(), v1.end());
    sort(v2.begin(), v2.end());
    reverse(v2.begin(), v2.end());
    cout << "YES" << endl;
    cout << v1.size() << endl;
    for (int i = 0; i < v1.size(); i++) {
      cout << v1[i] << " ";
    }
    cout << endl;
    cout << v2.size() << endl;
    for (int i = 0; i < v2.size(); i++) {
      cout << v2[i] << " ";
    }
    cout << endl;
  }
}
