#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long arr[n];
  vector<long long> a, b;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  for (int i = 0; i < n; i++) {
    if (arr[i] == arr[i + 1] && arr[i + 1] == arr[i + 2]) {
      cout << "NO\n";
      return;
    } else if (arr[i] == arr[i + 1]) {
      a.push_back(arr[i]);
      b.push_back(arr[i + 1]);
      i++;
    } else {
      a.push_back(arr[i]);
    }
  }
  cout << "YES\n";
  reverse(b.begin(), b.end());
  cout << a.size() << "\n";
  for (auto i : a) {
    cout << i << " ";
  }
  cout << "\n";
  cout << b.size() << "\n";
  for (auto i : b) {
    cout << i << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long T;
  T = 1;
  for (int t = 0; t < T; t++) {
    solve();
  }
  return 0;
}
