#include <bits/stdc++.h>
using namespace std;
vector<int> vec1, vec2, vec;
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    vec.clear();
    vec1.clear();
    vec2.clear();
    for (int i = 0; i < n; i++) {
      int temp;
      scanf("%d", &temp);
      vec.push_back(temp);
    }
    sort(vec.begin(), vec.end());
    int flag = 0;
    for (int i = 0; i < n - 2; i++) {
      if (vec[i] == vec[i + 1] && vec[i] == vec[i + 2]) {
        flag = 1;
        break;
      }
    }
    if (flag) {
      printf("NO\n");
      continue;
    }
    vec1.push_back(vec[0]);
    for (int i = 1; i < n; i++) {
      if (vec1.back() == vec[i])
        vec2.push_back(vec[i]);
      else {
        vec1.push_back(vec[i]);
      }
    }
    int len1 = vec1.size(), len2 = vec2.size();
    printf("YES\n");
    printf("%d\n", len1);
    for (int i = 0; i < len1; i++)
      i == 0 ? printf("%d", vec1[i]) : printf(" %d", vec1[i]);
    printf("\n");
    printf("%d\n", len2);
    for (int i = len2 - 1; i >= 0; i--)
      i == len2 - 1 ? printf("%d", vec2[i]) : printf(" %d", vec2[i]);
    printf("\n");
  }
  return 0;
}
