#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> re;
int main() {
  cin >> n;
  int least[n];
  for (int i = 0; i < n; i++) cin >> least[i];
  sort(least, least + n);
  int cont = 0;
  for (int i = 1; i < n; i++) {
    if (least[i] == least[i - 1]) {
      re.push_back(least[i]);
      least[i - 1] = -1;
      cont++;
    } else {
      cont = 0;
    }
    if (cont >= 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  sort(re.begin(), re.end());
  cout << "YES" << endl;
  cout << n - re.size() << endl;
  for (int i = 0; i < n; i++) {
    if (least[i] == -1) continue;
    cout << least[i] << " ";
  }
  cout << endl;
  cout << re.size() << endl;
  for (int i = re.size() - 1; i >= 0; i--) cout << re[i] << " ";
  cout << endl;
  return 0;
}
