#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 202222;
const int INF = 0x3f3f3f3f;
const long long MOD = 1e9 + 9;
using namespace std;
int n, a[MAXN];
vector<int> p1, p2;
bool ans = true;
void go(vector<int> p) {
  for (int i = 1; i < p.size(); i++)
    if (p[i] == p[i - 1]) {
      ans = false;
      return;
    }
  return;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
  }
  sort(a, a + n);
  p1.push_back(a[0]);
  for (int i = 1; i < n; i++) {
    if (a[i] > p1[p1.size() - 1])
      p1.push_back(a[i]);
    else
      p2.push_back(a[i]);
  }
  go(p1);
  go(p2);
  puts(ans ? "YES" : "NO");
  if (!ans) return 0;
  cout << p1.size() << endl;
  for (auto x : p1) printf("%d ", x);
  cout << endl;
  cout << p2.size() << endl;
  for (int i = p2.size() - 1; i >= 0; i--) printf("%d ", p2[i]);
  cout << endl;
}
