#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<int> v1;
  vector<int> v2;
  int freq[500000] = {0};
  for (int i = 0; i < n; i++) {
    freq[a[i]]++;
  }
  for (int i = 0; i < 500000; i++) {
    if (freq[i] > 2) {
      cout << "NO" << endl;
      return 0;
    }
    if (freq[i] == 2) {
      v1.push_back(i);
      v2.push_back(i);
    }
    if (freq[i] == 1) {
      v1.push_back(i);
    }
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end(), greater<int>());
  cout << "YES" << endl;
  cout << v1.size() << endl;
  for (int i = 0; i < v1.size(); i++) {
    cout << v1[i] << " ";
  }
  cout << endl;
  cout << v2.size() << endl;
  for (int i = 0; i < v2.size(); i++) {
    cout << v2[i] << " ";
  }
  cout << endl;
}
