#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, t = 0, n, s1, s2;
  vector<int> vec1, vec2;
  map<int, int> m;
  scanf("%d", &n);
  int *a;
  a = new int[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    m[a[i]]++;
    if (m[a[i]] > t) t = m[a[i]];
  }
  if (t > 2)
    printf("%s\n", "NO");
  else {
    sort(a, a + n);
    for (i = 0; i < n; i++) {
      if (a[i] != a[i + 1])
        vec1.push_back(a[i]);
      else {
        vec1.push_back(a[i]);
        vec2.push_back(a[i + 1]);
        i++;
      }
    }
    s1 = vec1.size();
    s2 = vec2.size();
    cout << "YES\n" << s2 << "\n";
    for (i = 0; i < s2; i++) cout << vec2[i] << " ";
    cout << "\n" << s1 << "\n";
    for (i = s1 - 1; i >= 0; i--) cout << vec1[i] << " ";
    cout << "\n";
  }
  return 0;
}
