#include <bits/stdc++.h>
using namespace std;
long long n;
long long *arr;
map<long long, long long> upp, downn;
inline void read() {
  cin >> n;
  arr = new long long[n];
  for (int i = 0; i < (n); i++) cin >> arr[i];
}
inline void solve() {
  sort(arr, arr + n);
  for (int i = 0; i < (n); i++) {
    if (upp.find(arr[i]) == upp.end())
      upp[arr[i]] = 1;
    else if (downn.find(arr[i]) == downn.end())
      downn[arr[i]] = 1;
    else {
      cout << "NO";
      exit(0);
    }
  }
  cout << "YES"
       << "\n"
       << upp.size() << "\n";
  for (auto it = upp.begin(); it != upp.end(); it++) {
    cout << it->first << ' ';
  }
  if (!(upp.size())) cout << "\n";
  cout << "\n" << downn.size() << "\n";
  for (auto it = downn.rbegin(); it != downn.rend(); it++) {
    cout << it->first << ' ';
  }
  if (!(downn.size())) cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  read();
  solve();
}
