#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> vc(2 * 100000 + 1), v1, v2, v3;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v3.push_back(x);
    vc[x]++;
    if (vc[x] > 2) {
      cout << "NO";
      return 0;
    }
  }
  sort(v3.begin(), v3.end());
  v1.push_back(v3[0]);
  for (int i = 1; i < v3.size(); i++) {
    if (v3[i] != v3[i - 1]) {
      v1.push_back(v3[i]);
    } else {
      v2.push_back(v3[i]);
    }
  }
  int p = v1.size(), q = v2.size();
  if (p > q) {
    cout << "YES" << endl;
    cout << q << endl;
    for (int i = 0; i < v2.size(); i++) {
      cout << v2[i] << " ";
    }
    printf("\n");
    reverse(v1.begin(), v1.end());
    cout << p << endl;
    for (int i = 0; i < v1.size(); i++) {
      cout << v1[i] << " ";
    }
  } else {
    cout << "YES" << endl;
    cout << p << endl;
    for (int i = 0; i < v1.size(); i++) {
      cout << v1[i] << " ";
    }
    printf("\n");
    reverse(v2.begin(), v2.end());
    cout << q << endl;
    for (int i = 0; i < v2.size(); i++) {
      cout << v2[i] << " ";
    }
  }
}
