#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  ios_base::sync_with_stdio(false);
  cin >> n;
  vector<int> nums(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> nums[i];
  }
  sort(nums.begin(), nums.end());
  vector<int> asc, desc;
  for (auto v : nums) {
    if (!desc.empty() && v == desc.back()) {
      cout << "NO\n";
      return 0;
    }
    if (!asc.empty() && v == asc.back()) {
      desc.push_back(v);
    } else {
      asc.push_back(v);
    }
  }
  cout << "YES\n";
  cout << asc.size() << "\n";
  for (auto v : asc) {
    cout << v << " ";
  }
  cout << "\n";
  reverse(desc.begin(), desc.end());
  cout << desc.size() << "\n";
  for (auto v : desc) {
    cout << v << " ";
  }
  cout << "\n";
  return 0;
}
