#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int a[N], vis[N], b[N], c[N];
int main() {
  bool flag = false;
  int n, cnt1 = 0, cnt2 = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    vis[a[i]]++;
    if (vis[a[i]] > 2) flag = true;
    if (vis[a[i]] == 2) b[cnt1++] = c[cnt2++] = a[i];
  }
  if (flag) {
    printf("NO\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (cnt2 >= 2 && vis[a[i]] == 1)
      b[cnt1++] = a[i];
    else if (vis[a[i]] == 1)
      c[cnt2++] = a[i];
  }
  sort(b, b + cnt1);
  sort(c, c + cnt2);
  printf("YES\n");
  if (!cnt1)
    printf("0\n\n");
  else {
    printf("%d\n%d", cnt1, b[0]);
    for (int i = 1; i < cnt1; i++) printf(" %d", b[i]);
    puts("");
  }
  printf("%d\n%d", cnt2, c[cnt2 - 1]);
  for (int i = cnt2 - 2; i >= 0; i--) printf(" %d", c[i]);
  puts("");
  return 0;
}
