#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1e6 + 1;
void solve() {
  long long n;
  cin >> n;
  unordered_map<long long, long long> mp;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  for (long long i = 0; i < n; i++) {
    if (mp[a[i]] > 2) {
      cout << "NO\n";
      return;
    }
  }
  sort(a, a + n);
  vector<long long> f, s;
  for (long long i = 0; i < n; i++) {
    if (f.size() == 0) {
      f.push_back(a[i]);
      continue;
    }
    if (f.back() == a[i]) {
      s.push_back(a[i]);
    } else {
      f.push_back(a[i]);
    }
  }
  cout << "YES\n";
  cout << f.size() << "\n";
  for (auto i : f) {
    cout << i << " ";
  }
  cout << "\n";
  reverse(s.begin(), s.end());
  cout << s.size() << "\n";
  for (auto i : s) {
    cout << i << " ";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
}
