#include <bits/stdc++.h>
using namespace std;
int arr[200005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  int now = arr[0], cnt = 1;
  set<int> sup;
  stack<int> sdown;
  sup.insert(now);
  for (int i = 1; i < n; i++) {
    if (arr[i] == now) {
      cnt++;
      sdown.push(arr[i]);
    } else {
      now = arr[i];
      sup.insert(now);
      cnt = 1;
    }
    if (cnt >= 3) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  cout << sup.size() << endl;
  bool flag = true;
  for (auto i = sup.begin(); i != sup.end(); i++) {
    if (flag) {
      cout << *i;
      flag = false;
    } else
      cout << " " << *i;
  }
  cout << endl;
  cout << sdown.size() << endl;
  flag = true;
  while (!sdown.empty()) {
    if (flag) {
      cout << sdown.top();
      flag = false;
    } else
      cout << " " << sdown.top() << endl;
    sdown.pop();
  }
  cout << endl;
  return 0;
}
