#include <bits/stdc++.h>
const int MAX_DORT = 200005;
int nbRooms[MAX_DORT];
signed main() {
  int n, val;
  std::cin >> n;
  std::vector<int> arr{};
  for (int i = 0; i < n; i++) {
    std::cin >> val;
    arr.push_back(val);
  }
  std::sort(arr.begin(), arr.end());
  std::vector<int> incre{};
  std::vector<int> decre{};
  for (int& x : arr) {
    if (incre.empty() || x > incre.back()) {
      incre.push_back(x);
    } else if (decre.empty() || x > decre.back()) {
      decre.push_back(x);
    } else {
      std::cout << "NO\n";
      return 0;
    }
  }
  std::cout << "YES\n";
  std::cout << incre.size() << '\n';
  for (int& x : incre) {
    std::cout << x << ' ';
  }
  std::cout << '\n' << decre.size() << '\n';
  for (int i = (int)decre.size() - 1; i >= 0; i--) {
    std::cout << decre[i] << ' ';
  }
}
