#include <bits/stdc++.h>
using namespace std;
int n, x1, x2, a;
multiset<int> v;
set<int> v2;
vector<int> res;
vector<int> res1;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    v.insert(a);
    v2.insert(a);
  }
  set<int>::iterator it;
  it = v2.begin();
  for (int i = 1; i <= v2.size(); i++) {
    if (v.count(*it) > 2) {
      cout << "NO";
      return 0;
    } else if (v.count(*it) == 2) {
      res.push_back(*it);
      res1.push_back(*it);
    } else
      res.push_back(*it);
    it++;
  }
  sort(res.begin(), res.end());
  sort(res1.begin(), res1.end());
  cout << "YES" << endl;
  cout << res.size() << endl;
  for (int i = 0; i < res.size(); i++) cout << res[i] << ' ';
  cout << endl;
  cout << res1.size() << endl;
  for (int i = res1.size() - 1; i >= 0; i--) cout << res1[i] << ' ';
  cout << endl;
  return 0;
}
