#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2e6 + 10;
const int Mod = 1e5;
const int INF = 0x3f3f3f3f;
int a[Maxn];
int ans1[Maxn], ans2[Maxn];
int vis[Maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    vis[a[i]]++;
    if (vis[a[i]] >= 3) {
      cout << "NO" << endl;
      return 0;
    }
  }
  sort(a + 1, a + n + 1);
  int k1 = 0, k2 = 0;
  int flag = 0;
  for (int i = 0; i <= 2e5; i++) {
    if (vis[i] == 2) {
      ans1[k1++] = i;
      ans2[k2++] = i;
    } else if (vis[i] == 1) {
      ans1[k1++] = i;
    }
  }
  cout << "YES" << endl;
  cout << k1 << endl;
  for (int i = 0; i < k1; i++) {
    cout << ans1[i] << " ";
  }
  cout << endl;
  cout << k2 << endl;
  for (int i = k2 - 1; i >= 0; i--) {
    cout << ans2[i] << " ";
  }
  cout << endl;
  return 0;
}
