#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> arr(n, 0);
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr.begin(), arr.end());
  vector<int> incr;
  vector<int> decr;
  incr.push_back(arr[0]);
  for (int i = 1; i < n; i++) {
    if (i > 1 && arr[i] == arr[i - 1] && arr[i] == arr[i - 2]) {
      cout << "NO"
           << "\n";
      return 0;
    }
    if (arr[i] == arr[i - 1]) {
      decr.push_back(arr[i]);
    } else
      incr.push_back(arr[i]);
  }
  cout << "YES"
       << "\n";
  cout << incr.size() << "\n";
  for (int i = 0; i < (int)incr.size(); i++) {
    cout << incr[i] << " ";
  }
  cout << "\n";
  cout << decr.size() << "\n";
  for (int i = (int)decr.size() - 1; i > -1; i--) {
    cout << decr[i] << " ";
  }
  cout << "\n";
  return 0;
}
