#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int arr[n];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  vector<int> inc;
  vector<int> dec;
  for (long long i = 0; i < n; i++) {
    int cnt = 0, j = i;
    while (arr[i] == arr[j]) {
      cnt++;
      j++;
    }
    i = j - 1;
    if (cnt > 2) {
      cout << "NO";
      return 0;
    }
    if (cnt == 1) inc.push_back(arr[i]);
    if (cnt == 2) {
      inc.push_back(arr[i]);
      dec.push_back(arr[i]);
    }
  }
  cout << "YES" << endl;
  cout << inc.size() << endl;
  for (long long i = 0; i < inc.size(); i++) cout << inc[i] << " ";
  cout << endl;
  cout << dec.size() << endl;
  for (int i = dec.size() - 1; i >= 0; i--) cout << dec[i] << " ";
  cout << endl;
  return 0;
}
