#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int jl[maxn];
int arr[maxn];
int n;
int main() {
  cin >> n;
  int a;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    jl[a]++;
    if (jl[a] >= 3) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  int cnt = 0;
  for (int i = 0; i <= 2e5; i++) {
    if (jl[i]) {
      ++cnt;
      arr[cnt] = i;
      jl[i]--;
    }
  }
  cout << cnt << endl;
  for (int i = 1; i <= cnt; i++) {
    cout << arr[i];
    if (i != cnt) cout << " ";
  }
  cout << endl;
  cnt = 0;
  for (int i = 2e5; i >= 0; i--) {
    if (jl[i]) {
      ++cnt;
      arr[cnt] = i;
      jl[i]--;
    }
  }
  cout << cnt << endl;
  for (int i = 1; i <= cnt; i++) {
    cout << arr[i];
    if (i != cnt) cout << " ";
  }
  cout << endl;
  return 0;
}
