#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ele, flag = 0;
  cin >> n;
  unordered_map<int, int> mp;
  vector<int> v, v1, v2;
  while (n--) {
    cin >> ele;
    if (flag == 0) {
      v.push_back(ele);
      if (mp.find(ele) == mp.end())
        mp[ele] = 1;
      else if (mp[ele] == 1)
        mp[ele] = 2;
      else
        flag = 1;
    }
  }
  if (flag == 1)
    cout << "NO" << endl;
  else {
    sort(v.begin(), v.end());
    for (int i = 0; i < v.size() - 1; i++) {
      if (v[i] == v[i + 1]) {
        v1.push_back(v[i]);
        v2.push_back(v[i + 1]);
        i++;
      } else
        v1.push_back(v[i]);
    }
    if (v[v.size() - 2] != v[v.size() - 1]) v1.push_back(v[v.size() - 1]);
    cout << "YES" << endl;
    reverse(v1.begin(), v1.end());
    cout << v2.size() << endl;
    for (int i = 0; i < v2.size(); i++) cout << v2[i] << " ";
    cout << endl;
    cout << v1.size() << endl;
    for (int i = 0; i < v1.size(); i++) cout << v1[i] << " ";
    cout << endl;
  }
  return 0;
}
