#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[n];
  int c[200010];
  int q = 200010;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < q; i++) c[i] = 0;
  for (int i = 0; i < n; i++) {
    c[a[i]]++;
  }
  vector<int> inc;
  vector<int> dec;
  for (int i = 0; i < q; i++) {
    if (c[i] > 2) {
      cout << "NO" << endl;
      return 0;
    } else if (c[i] == 0)
      continue;
    else if (c[i] == 1) {
      inc.push_back(i);
    } else {
      inc.push_back(i);
      dec.push_back(i);
    }
  }
  reverse(dec.begin(), dec.end());
  cout << "YES" << endl;
  cout << inc.size() << endl;
  for (int i = 0; i < inc.size(); i++) cout << inc[i] << " ";
  cout << endl;
  cout << dec.size() << endl;
  for (int i = 0; i < dec.size(); i++) cout << dec[i] << " ";
  cout << endl;
  return 0;
}
