#include <bits/stdc++.h>
using namespace std;
long long n, a[200000], c[200000];
unordered_map<long long, long long> mp;
void run() {
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long count = 0;
  for (long long i = 0; i < n; i++) {
    c[i] = mp[a[i]];
    mp[a[i]] += 1;
    count += (mp[a[i]] == 2);
    if (mp[a[i]] > 2) {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
  cout << (n - count) << endl;
  for (long long i = 0; i < n; i++) {
    if (c[i] == 0) {
      cout << a[i] << " ";
    }
  }
  cout << endl;
  cout << (count) << endl;
  for (long long i = n - 1; i >= 0; i--) {
    if (c[i] == 1) {
      cout << a[i] << " ";
    }
  }
  cout << endl;
}
void setup() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cout << setprecision(20);
}
signed main() {
  setup();
  long long tests = 1;
  for (long long i = 1; i <= tests; i++) run();
  return 0;
}
