#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 10;
int cnt[MAX];
vector<int> up, down;
int main() {
  ios::sync_with_stdio(false);
  memset(cnt, 0, sizeof(cnt));
  int n, x, max_num = -1;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    cnt[x]++;
    max_num = max(max_num, x);
  }
  for (int i = 0; i <= max_num; i++) {
    if (cnt[i] > 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  for (int i = max_num; i >= 0; i--) {
    if (cnt[i]) {
      down.push_back(i);
      cnt[i]--;
    }
  }
  for (int i = 0; i <= max_num; i++) {
    if (cnt[i]) {
      up.push_back(i);
      cnt[i]--;
    }
  }
  cout << "YES" << endl;
  cout << up.size() << endl;
  if (up.size() > 0) {
    for (int i = 0; i < up.size() - 1; i++) cout << up[i] << " ";
    cout << up[up.size() - 1] << endl;
  } else {
    cout << " " << endl;
  }
  cout << down.size() << endl;
  if (down.size() > 0) {
    for (int i = 0; i < down.size() - 1; i++) cout << down[i] << " ";
    cout << down[down.size() - 1] << endl;
  } else {
    cout << " " << endl;
  }
  return 0;
}
