#include <bits/stdc++.h>
using namespace std;
vector<long long> v1, v2;
bool vis[1000000];
bool vis1[1000000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long total;
  cin >> total;
  bool mark = 1;
  for (long long i = 1; i <= total; i++) {
    long long val;
    cin >> val;
    if (!vis[val]) {
      vis[val] = 1;
      v1.push_back(val);
    } else if (vis[val] && !vis1[val]) {
      vis1[val] = 1;
      v2.push_back(val);
    } else
      mark = false;
  }
  if (!mark)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    sort(v1.begin(), v1.end());
    sort(v2.rbegin(), v2.rend());
    cout << v1.size() << endl;
    for (long long i = 0; i < v1.size(); i++) cout << v1[i] << " ";
    if (v1.size()) cout << endl;
    cout << v2.size() << endl;
    for (long long i = 0; i < v2.size(); i++) cout << v2[i] << " ";
    if (v2.size()) cout << endl;
  }
}
