#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  list<long long int> inc, dec;
  for (long long int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  for (long long int i = 0; i < n; i++) {
    if (!inc.size() || inc.back() < v[i])
      inc.push_back(v[i]);
    else if (!dec.size() || dec.front() < v[i])
      dec.push_front(v[i]);
    else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n" << inc.size() << "\n";
  for (auto e : inc) cout << e << " ";
  cout << "\n" << dec.size() << "\n";
  for (auto e : dec) cout << e << " ";
  return 0;
}
