#include <bits/stdc++.h>
using namespace std;
int n, a[200005], b[200005], x, f[200005], cnt1, cnt2;
inline int read() {
  char c = getchar();
  long long x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
bool cmp(int x, int y) { return x > y; }
int main() {
  n = read();
  for (int i = 1; i <= n; i++) {
    x = read();
    f[x]++;
    if (f[x] == 1) {
      cnt1++;
      a[cnt1] = x;
      continue;
    }
    if (f[x] == 2) {
      cnt2++;
      b[cnt2] = x;
      continue;
    }
    if (f[x] == 3) {
      printf("NO");
      return 0;
    }
  }
  printf("YES\n");
  printf("%d\n", cnt1);
  sort(a + 1, a + cnt1 + 1);
  for (int i = 1; i <= cnt1; i++) printf("%d ", a[i]);
  printf("\n");
  printf("%d\n", cnt2);
  if (!cnt2)
    printf("\n");
  else {
    sort(b + 1, b + 1 + cnt2, cmp);
    for (int i = 1; i <= cnt2; i++) printf("%d ", b[i]);
  }
  return 0;
}
