#include <bits/stdc++.h>
using namespace std;
int a[200005], b[200005], vis[200005];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n;
  scanf("%d", &n);
  int numa = 0, numb = 0, flag = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (vis[x])
      a[numa++] = x, vis[x]++;
    else
      b[numb++] = x, vis[x]++;
    if (vis[x] > 2) flag = 1;
  }
  if (flag)
    printf("NO\n");
  else {
    printf("YES\n");
    sort(a, a + numa);
    sort(b, b + numb, cmp);
    printf("%d\n", numa);
    int flag1 = 0;
    for (int i = 0; i < numa; i++) {
      if (flag1) printf(" ");
      flag1 = 1;
      printf("%d", a[i]);
    }
    printf("\n");
    flag1 = 0;
    printf("%d\n", numb);
    for (int i = 0; i < numb; i++) {
      if (flag1) printf(" ");
      flag1 = 1;
      printf("%d", b[i]);
    }
  }
  return 0;
}
