#include <bits/stdc++.h>
using namespace std;
vector<long long> adj[200005];
bool visited[200005];
long long cost[200005];
long long x;
int32_t main() {
  long long n;
  cin >> n;
  vector<long long> v;
  map<long long, long long> m;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    m[x]++;
    v.push_back(x);
  }
  vector<long long> a, b;
  sort(v.begin(), v.end());
  for (long long i = 0; i < n; i++) {
    if (m[v[i]] > 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  for (long long i = 0; i < n; i++) {
    if (m[v[i]] == 1) {
      a.push_back(v[i]);
    }
    if (m[v[i]] == 2) {
      a.push_back(v[i]);
      b.push_back(v[i]);
      m[v[i + 1]] = 0;
    }
  }
  reverse(a.begin(), a.end());
  cout << "YES" << endl;
  cout << b.size() << endl;
  for (long long i = 0; i < b.size(); i++) {
    cout << b[i] << " ";
  }
  cout << endl;
  cout << a.size() << endl;
  for (long long i = 0; i < a.size(); i++) {
    cout << a[i] << " ";
  }
}
