#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  vector<int> a, b;
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    m[x]++;
  }
  for (auto i : m) {
    if (i.second > 2) {
      cout << "NO";
      return 0;
    } else if (i.second == 2)
      b.push_back(i.first);
    else
      a.push_back(i.first);
  }
  for (int i = 0; i < b.size(); i++) {
    a.push_back(b[i]);
  }
  cout << "YES\n";
  sort(a.begin(), a.end());
  sort(b.rbegin(), b.rend());
  cout << a.size() << "\n";
  for (int i = 0; i < a.size(); i++) cout << a[i] << " ";
  cout << "\n" << b.size() << "\n";
  for (int i = 0; i < b.size(); i++) cout << b[i] << " ";
  return 0;
}
