#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> m;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    m[a[i]]++;
  }
  sort(a.begin(), a.end());
  for (auto it : m)
    if (it.second > 2) {
      cout << "NO";
      return 0;
    }
  vector<int> c, b;
  for (auto it : m) {
    c.push_back(it.first);
    if (it.second == 2) b.push_back(it.first);
  }
  reverse(b.begin(), b.end());
  cout << "YES\n";
  cout << c.size() << "\n";
  for (auto it : c) cout << it << " ";
  cout << "\n" << b.size() << "\n";
  for (auto it : b) cout << it << " ";
}
