#include <bits/stdc++.h>
using namespace std;
int a[200500], f[200500];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t, n, i;
  cin >> n;
  memset(f, 0, sizeof(f));
  set<int> s;
  vector<int> v;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    f[a[i]]++;
    if (f[a[i]] > 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  for (i = 0; i < n; i++) {
    if (f[a[i]] > 0 && s.find(a[i]) == s.end()) {
      s.insert(a[i]);
      f[a[i]]--;
    } else if (f[a[i]] > 0) {
      v.push_back(a[i]);
      f[a[i]]--;
    }
  }
  cout << "YES" << endl;
  sort(v.begin(), v.end(), greater<int>());
  cout << s.size() << endl;
  for (auto it = s.begin(); it != s.end(); it++) cout << *it << " ";
  cout << endl;
  cout << v.size() << endl;
  for (auto it = v.begin(); it != v.end(); it++) cout << *it << " ";
  cout << endl;
}
