#include <bits/stdc++.h>
using namespace std;
const int N = 200 * 1000 + 1;
int main() {
  int n;
  cin >> n;
  vector<int> cnt(N);
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    ++cnt[x];
    if (cnt[x] > 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl << count(cnt.begin(), cnt.end(), 2) << endl;
  for (int i = 0; i <= N; ++i) {
    if (cnt[i] == 2) {
      cout << i << " ";
      --cnt[i];
    }
  }
  cout << endl << count(cnt.begin(), cnt.end(), 1) << endl;
  for (int i = N; i >= 0; --i) {
    if (cnt[i] == 1) {
      cout << i << " ";
      --cnt[i];
    }
  }
  cout << endl;
  return 0;
}
