#include <bits/stdc++.h>
using namespace std;
int c_2(vector<long long> x, int r) {
  int rez = 0;
  for (int i = 0; i < x.size(); i++) {
    if (x[i] == r) {
      rez++;
    }
  }
  return rez;
}
int main() {
  int n;
  cin >> n;
  vector<long long> sr(200 * 1000 + 1);
  for (int i = 0; i < n; i++) {
    int l;
    cin >> l;
    sr[l]++;
    if (sr[l] > 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  cout << c_2(sr, 2) << endl;
  for (int i = 0; i < 20 * 10000; i++) {
    if (sr[i] == 2) {
      cout << i << ' ';
      sr[i]--;
    }
  }
  cout << endl;
  cout << c_2(sr, 1) << endl;
  for (int i = 20 * 10000; i >= 0; i--) {
    if (sr[i] == 1) {
      cout << i << ' ';
      sr[i]--;
    }
  }
  cout << endl;
  return 0;
}
