#include <bits/stdc++.h>
using namespace std;
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
template <class T>
ostream &operator<<(ostream &os, set<T> V) {
  os << "[";
  for (auto vv : V) os << vv << ",";
  return os << "]";
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[";
  for (auto vv : V) os << vv << ",";
  return os << "]";
}
template <class K, class X>
ostream &operator<<(ostream &os, map<K, X> V) {
  os << "[";
  for (auto vv : V) os << vv << ",";
  return os << "]";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << H;
  debug_out(T...);
}
int32_t main() {
  long long n;
  cin >> n;
  vector<long long> arr(n);
  map<long long, long long> count;
  vector<long long> a1, a2;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    count[arr[i]]++;
    if (count[arr[i]] > 2) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  sort(arr.begin(), arr.end());
  for (long long i = 0; i < n; i++) {
    if (i % 2) {
      a1.push_back(arr[i]);
    } else
      a2.push_back(arr[i]);
  }
  cout << a1.size() << endl;
  for (long long i = 0; i < a1.size(); i++) {
    cout << a1[i] << " ";
  }
  cout << endl << a2.size() << endl;
  for (long long i = a2.size() - 1; i >= 0; i--) {
    cout << a2[i] << " ";
  }
  cout << endl;
  return 0;
}
