#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int n;
int a[N];
vector<int> ninc, ndec;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    if (ninc.empty() || ninc.back() != a[i])
      ninc.push_back(a[i]);
    else if (ndec.empty() || ndec.back() != a[i])
      ndec.push_back(a[i]);
    else {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  cout << ninc.size() << endl;
  for (int i = 0; i < ninc.size(); ++i) cout << ninc[i] << ' ';
  cout << endl;
  cout << ndec.size() << endl;
  for (int i = ndec.size() - 1; i >= 0; --i) cout << ndec[i] << ' ';
  cout << endl;
}
