#include <bits/stdc++.h>
using namespace std;
const long long HELL = 1e9 + 7;
long long solve() {
  long long n;
  cin >> n;
  long long arr[n];
  std::map<long long, long long> map;
  for (long long i = 0; i < n; ++i) {
    cin >> arr[i];
    map[arr[i]]++;
    if (map[arr[i]] > 2) {
      cout << "NO" << '\n';
      return 0;
    }
  }
  set<long long> s(arr, arr + n);
  std::vector<long long> v1, v2;
  for (std::set<long long>::iterator i = s.begin(); i != s.end(); ++i) {
    if (map[*i] == 1)
      v1.push_back(*i);
    else {
      v2.push_back(*i);
      v1.push_back(*i);
    }
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end(), greater<long long>());
  cout << "YES" << '\n';
  cout << v1.size() << '\n';
  if (v1.size() == 0)
    cout << " " << '\n';
  else {
    for (std::vector<long long>::iterator i = v1.begin(); i != v1.end(); ++i) {
      cout << *i << " ";
    }
    cout << '\n';
  }
  cout << v2.size() << '\n';
  if (v2.size() == 0)
    cout << " " << '\n';
  else {
    for (std::vector<long long>::iterator i = v2.begin(); i != v2.end(); ++i) {
      cout << *i << " ";
    }
    cout << '\n';
  }
}
int32_t main() {
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
