#include <bits/stdc++.h>
using namespace std;
bool is_prime(long long x) {
  if (x == 1) return false;
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
bool is_palindrome(string s1) {
  int l = s1.length();
  for (int i = 0; i < l / 2; i++)
    if (s1[i] != s1[l - i - 1]) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int n;
  cin >> n;
  vector<long long int> v, b, c;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    v.push_back(x);
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    auto r = equal_range(v.begin(), v.end(), v[i]);
    if ((r.second - r.first) >= 3) {
      cout << "NO";
      return 0;
    }
  }
  for (int i = 0; i < v.size(); i++) {
    if (v[i] == v[i + 1]) {
      b.push_back(v[i]);
      c.push_back(v[i + 1]);
      i++;
    } else
      b.push_back(v[i]);
  }
  cout << "YES\n";
  cout << c.size() << "\n";
  for (long long int i = 0; i < c.size(); i++) cout << c[i] << " ";
  cout << "\n";
  sort(b.rbegin(), b.rend());
  cout << b.size() << "\n";
  for (long long int i = 0; i < b.size(); i++) cout << b[i] << " ";
  cout << "\n";
}
