#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return power(x, y / 2) * power(x, y / 2);
  else
    return x * power(x, y / 2) * power(x, y / 2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int a[n];
  map<long long int, long long int> m;
  long long int flag = 0;
  std::vector<long long int> in, d;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
    if (m[a[i]] > 2) {
      flag = 1;
    }
    if (m[a[i]] == 2) {
      in.push_back(a[i]);
      d.push_back(a[i]);
    }
  }
  if (flag) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (m[a[i]] == 1) in.push_back(a[i]);
  }
  sort(in.begin(), in.end());
  sort(d.begin(), d.end());
  cout << "YES" << endl;
  cout << d.size() << endl;
  for (int i = 0; i < d.size(); i++) {
    cout << d[i] << " ";
  }
  cout << endl;
  ;
  cout << in.size() << endl;
  for (int i = in.size() - 1; i >= 0; i--) {
    cout << in[i] << " ";
  }
  return 0;
}
