#include <bits/stdc++.h>
const long long MAXN = 1e10;
long long pwr(long long a, long long b, long long mod) {
  a %= mod;
  if (a < 0) a += mod;
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b /= 2;
  }
  return ans;
}
long long pwr(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans *= a;
    a *= a;
    b /= 2;
  }
  return ans;
}
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr.begin(), arr.end());
  vector<int> arr1, arr2;
  arr1.push_back(arr[0]);
  for (int i = 1; i < n; i++) {
    if (arr[i] == arr[i - 1])
      arr2.push_back(arr[i]);
    else
      arr1.push_back(arr[i]);
  }
  sort(arr1.begin(), arr1.end());
  sort(arr2.rbegin(), arr2.rend());
  bool pos = true;
  for (int i = 1; i < (int)arr1.size(); i++) {
    if (arr1[i] == arr1[i - 1]) {
      pos = false;
      break;
    }
  }
  if (!pos) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 1; i < (int)arr2.size(); i++) {
    if (arr2[i] == arr2[i - 1]) {
      pos = false;
      break;
    }
  }
  if (!pos) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  cout << (int)arr1.size() << "\n";
  for (int i : arr1) cout << i << " ";
  cout << "\n";
  cout << (int)arr2.size() << "\n";
  for (int i : arr2) cout << i << " ";
  cout << "\n";
  return 0;
}
