#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
const long long INT = 1e9;
bool cmp(int x, int y) { return x > y; }
int a[200006];
int b[200006], c[200006], d[200006];
int main() {
  int n;
  memset(b, 0, sizeof(b));
  a[0] = -5;
  scanf("%d", &n);
  int flag = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    b[a[i]]++;
    if (b[a[i]] >= 3) flag = 0;
  }
  if (flag == 0) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  sort(a + 1, a + 1 + n, cmp);
  int ans = 0;
  int l1 = 1, l2 = 1;
  for (int i = 1; i <= n; i++) {
    if (a[i] == a[i - 1]) continue;
    if (b[a[i]] == 2) d[l2++] = a[i];
    c[l1++] = a[i];
  }
  printf("%d\n", l2 - 1);
  for (int i = l2 - 1; i >= 2; i--) printf("%d ", d[i]);
  if (l2 - 1 >= 1) printf("%d", d[1]);
  printf("\n%d\n", l1 - 1);
  for (int i = 1; i < l1 - 1; i++) printf("%d ", c[i]);
  if (l1 - 1 >= 1) printf("%d", c[l1 - 1]);
  printf("\n");
  return 0;
}
