#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int n, m;
vector<int> a, b, c;
int main() {
  int t;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    cin >> t;
    a.emplace_back(t);
  }
  for (int i = 0; i < 1; i++) printf("");
  sort(a.begin(), a.end());
  for (int i = 1; i < a.size(); ++i) {
    if (a[i] == a[i - 1]) b.emplace_back(a[i]);
  }
  for (int i = 0; i < 1; i++) printf("");
  for (int i = 1; i < b.size(); ++i) {
    if (b[i] == b[i - 1]) c.emplace_back(b[i]);
  }
  for (int i = 0; i < 1; i++) printf("");
  if (c.size()) {
    puts("NO");
    return 0;
  }
  puts("YES");
  for (int i = 0; i < 1; i++) printf("");
  int num = unique(a.begin(), a.end()) - a.begin();
  cout << num << endl;
  for (int i = 0; i < 1; i++) printf("");
  for (int i = 0; i < num; ++i) {
    cout << a[i] << ' ';
  }
  for (int i = 0; i < 1; i++) printf("");
  cout << endl << n - num << endl;
  for (int i = 0; i < 1; i++) printf("");
  for (int i = b.size() - 1; i >= 0; --i) {
    cout << b[i] << ' ';
  }
  for (int i = 0; i < 1; i++) printf("");
  return 0;
}
