#include <bits/stdc++.h>
using namespace std;
long long pwr(long long base, long long p, long long mod = (1000000007LL)) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    p /= 2;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long nCr(long long n, long long r) {
  long long C[r + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (long long i = 1; i <= n; i++)
    for (long long j = min(i, r); j > 0; j--) C[j] = C[j] + C[j - 1];
  return C[r];
}
long long M(long long a) { return (a % (1000000007LL)); }
bool isPowerOfTwo(long long x) { return x && (!(x & (x - 1))); }
void printVLL(vector<long long> &A) {
  for (auto i : A) cout << i << " ";
  cout << endl;
  return;
}
struct hash_func {
  bool operator()(const pair<long long, long long> a) const {
    return a.first * 71 + a.second * 1971;
  }
};
void solve() {
  int n;
  cin >> n;
  vector<long long> A(n);
  for (long long i = 0; i < (long long)(n); ++i) cin >> A[i];
  sort((A).begin(), (A).end());
  map<int, int> f;
  for (auto i : A) f[i]++;
  for (auto i : f) {
    if (i.second > 2) {
      cout << "NO" << endl;
      return;
    }
  }
  vector<long long> a, b;
  f.clear();
  for (auto i : A) {
    if (f.find(i) == f.end()) {
      a.push_back(i);
      f[i] = 1;
    } else {
      b.push_back(i);
    }
  }
  sort((a).begin(), (a).end());
  sort((b).begin(), (b).end(), greater<int>());
  cout << "YES" << endl;
  cout << a.size() << endl;
  for (auto i : a) cout << i << " ";
  cout << endl;
  cout << b.size() << endl;
  for (auto i : b) cout << i << " ";
  cout << endl;
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
