#include <bits/stdc++.h>
using namespace std;
int a[200000 + 5], num[200000 + 5];
vector<int> dcr;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i <= n - 1; i++) {
    cin >> a[i];
    num[a[i]]++;
    if (num[a[i]] > 2) return cout << "NO" << endl, 0;
  }
  sort(a, a + n);
  for (int i = 1; i <= n - 1; i++) {
    if (a[i] == a[i - 1]) {
      dcr.push_back(a[i]);
      a[i] = -1;
    }
  }
  cout << "YES" << endl << n - dcr.size() << endl;
  for (int i = 0; i <= n - 1; i++) {
    if (a[i] == -1) continue;
    cout << a[i] << " ";
  }
  cout << endl << dcr.size() << endl;
  for (int i = dcr.size() - 1; i >= 0; i--) {
    cout << dcr[i] << " ";
  }
  cout << endl;
  return 0;
}
