#include <bits/stdc++.h>
using namespace std;
int n, a[200001], f[200001];
vector<int> b, c;
bool k;
void nhap() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    f[a[i]]++;
    if (f[a[i]] == 3) k = 1;
    if (f[a[i]] == 1)
      b.push_back(a[i]);
    else
      c.push_back(a[i]);
  }
}
void process() {
  cout << "YES"
       << "\n";
  sort(b.begin(), b.end());
  sort(c.begin(), c.end());
  cout << b.size() << "\n";
  for (int i = 0; i < b.size(); ++i) cout << b[i] << " ";
  cout << "\n" << c.size() << "\n";
  for (int i = c.size() - 1; i >= 0; --i) cout << c[i] << " ";
}
int main() {
  nhap();
  if (k)
    cout << "NO";
  else
    process();
  return 0;
}
