#include <bits/stdc++.h>
using namespace std;
long long n, i;
int main() {
  cin >> n;
  vector<long long> a(n), b, c;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  for (i = 0; i < n; i++) {
    if (a[i] == a[i + 1])
      b.push_back(a[i]);
    else
      c.push_back(a[i]);
    if (i > 0 && a[i - 1] == a[i] && a[i] == a[i + 1]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  reverse(c.begin(), c.end());
  cout << b.size() << endl;
  for (i = 0; i < b.size(); i++) cout << b[i] << ' ';
  cout << endl;
  cout << c.size() << endl;
  for (i = 0; i < c.size(); i++) cout << c[i] << ' ';
}
