#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> V, A, B;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int z;
    cin >> z;
    V.push_back(z);
  }
  sort(V.begin(), V.end());
  bool p = true;
  int lp = V[n - 1], pos = n - 1;
  A.push_back(lp);
  for (int i = n - 2; i >= 0 and p; i--) {
    if (V[i] == lp) {
      if (pos - i == 1)
        B.push_back(V[i]);
      else
        p = false;
    } else {
      A.push_back(V[i]);
      lp = V[i];
      pos = i;
    }
  }
  sort(A.begin(), A.end());
  if (p) {
    cout << "YES\n";
    cout << A.size() << endl;
    for (int i = 0; i < A.size(); i++) {
      cout << A[i];
      if (i != A.size() - 1) cout << " ";
    }
    cout << endl;
    cout << B.size() << endl;
    for (int i = 0; i < B.size(); i++) {
      cout << B[i];
      if (i != B.size() - 1) cout << " ";
    }
    cout << endl;
  } else
    cout << "NO\n";
  return 0;
}
