#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int maxn = 2e6 + 7;
int a[maxn];
int vis[maxn];
int main() {
  int n;
  while (cin >> n) {
    memset(vis, 0, sizeof(vis));
    int flag = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
      vis[a[i]]++;
      if (vis[a[i]] > 2) {
        flag = 1;
      }
    }
    if (flag) {
      cout << "NO" << endl;
      continue;
    } else {
      cout << "YES\n";
    }
    memset(vis, 0, sizeof(vis));
    sort(a, a + n);
    vector<int> inc, dec;
    inc.push_back(a[0]);
    vis[0] = 1;
    for (int i = 1; i < n; i++) {
      if (a[i] != a[i - 1]) {
        inc.push_back(a[i]);
        vis[i] = 1;
      }
    }
    for (int i = n - 1; i >= 0; i--) {
      if (vis[i]) continue;
      dec.push_back(a[i]);
    }
    cout << inc.size() << endl;
    for (int i = 0; i < inc.size(); i++) {
      if (i) cout << ' ';
      cout << inc[i];
    }
    cout << endl;
    cout << dec.size() << endl;
    for (int i = 0; i < dec.size(); i++) {
      if (i) cout << ' ';
      cout << dec[i];
    }
    cout << endl;
  }
  return 0;
}
