#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  bool t = true;
  int n;
  cin >> n;
  int a[200001] = {0};
  vector<int> voz;
  vector<int> yb;
  for (int i = 0; i < n; i++) {
    int c;
    cin >> c;
    a[c]++;
    if (a[c] > 2) {
      cout << "NO";
      t = false;
      break;
    } else if (a[c] == 1) {
      yb.push_back(c);
    } else if (a[c] == 2) {
      voz.push_back(c);
    }
  }
  if (t) {
    sort(voz.begin(), voz.end());
    sort(yb.begin(), yb.end());
    cout << "YES" << '\n';
    cout << voz.size() << '\n';
    for (int i = 0; i < voz.size(); i++) {
      cout << voz[i] << ' ';
    }
    cout << '\n';
    cout << yb.size() << '\n';
    reverse(yb.begin(), yb.end());
    for (int i = 0; i < yb.size(); i++) {
      cout << yb[i] << ' ';
    }
  }
}
