#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> nums(n);
  for (int i = 0; i < n; i++) cin >> nums[i];
  if (n == 1) {
    cout << "YES" << endl << 1 << endl << nums[0] << endl << 0 << endl;
    return 0;
  }
  sort(nums.begin(), nums.end());
  vector<int> in, dec;
  in.push_back(nums[0]);
  dec.push_back(nums[1]);
  for (int i = 2; i < n; i++) {
    if (in.back() != nums[i]) {
      in.push_back(nums[i]);
    } else if (dec.back() != nums[i]) {
      dec.push_back(nums[i]);
    } else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES" << endl;
  cout << in.size() << endl;
  for (int i = 0; i < in.size(); i++) cout << in[i] << ' ';
  cout << endl << dec.size() << endl;
  for (int i = dec.size() - 1; i >= 0; i--) cout << dec[i] << ' ';
  return 0;
}
