#include <bits/stdc++.h>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;
template <class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (auto &&i : v) scanf("%d", &i);
  sort(v.begin(), v.end());
  vector<int> a, b;
  for (int i = 0; i < n; ++i) {
    if (a.empty() || a.back() != v[i]) {
      a.emplace_back(v[i]);
    } else if (b.empty() || b.back() != v[i]) {
      b.emplace_back(v[i]);
    } else {
      puts("NO");
      return 0;
    }
  }
  reverse(b.begin(), b.end());
  puts("YES");
  cout << a.size() << "\n";
  for (int i = 0; i < a.size(); ++i) {
    if (i) printf(" ");
    printf("%d", a[i]);
  }
  puts("");
  cout << b.size() << "\n";
  for (int i = 0; i < b.size(); ++i) {
    if (i) printf(" ");
    printf("%d", b[i]);
  }
  puts("");
  return 0;
}
