#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a;
  cin >> N;
  vector<int> v, v1, v2;
  for (int i = 0; i < N; i++) {
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  int len = 0, prev = -1;
  for (int i = 0; i < N; i++) {
    len = v[i] == prev ? len + 1 : 1;
    prev = v[i];
    if (len > 2) {
      cout << "NO" << endl;
      exit(0);
    }
    if (len == 1)
      v1.push_back(v[i]);
    else
      v2.push_back(v[i]);
  }
  cout << "YES" << endl;
  sort(v2.rbegin(), v2.rend());
  cout << v1.size() << endl;
  for (int i : v1) cout << i << ' ';
  cout << endl;
  cout << v2.size() << endl;
  for (int i : v2) cout << i << ' ';
  cout << endl;
}
