#include <bits/stdc++.h>
using namespace std;
int vis[200005] = {0};
int a[200005], b[200005];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n;
  cin >> n;
  bool flag = 0;
  int te;
  int lena = 0, lenb = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &te);
    if (flag) continue;
    if (vis[te] == 0) {
      a[lena++] = te;
      vis[te]++;
    } else if (vis[te] == 1) {
      b[lenb++] = te;
      vis[te]++;
    } else
      flag = 1;
  }
  if (flag)
    printf("No\n");
  else {
    cout << "Yes" << endl;
    sort(a, a + lena);
    printf("%d\n", lena);
    for (int i = 0; i < lena; i++) {
      printf("%d", a[i]);
      if (i != lena - 1) printf(" ");
    }
    printf("\n");
    sort(b, b + lenb, cmp);
    printf("%d\n", lenb);
    for (int i = 0; i < lenb; i++) {
      printf("%d", b[i]);
      if (i != lenb - 1) printf(" ");
    }
    cout << endl;
  }
  return 0;
}
