#include <bits/stdc++.h>
using namespace std;
bool cmpNum(int &a, int &b) { return a > b; }
int main() {
  int n, num;
  cin >> n;
  map<int, int> str;
  vector<int> res1, res2;
  for (int i = 0; i < n; i++) {
    cin >> num;
    if (str.find(num) == str.end())
      str[num] = 1;
    else
      str[num] += 1;
  }
  bool isNorm = true;
  for (std::map<int, int>::iterator it = str.begin(); it != str.end(); ++it) {
    if (it->second > 2) {
      isNorm = false;
      break;
    }
  }
  if (!isNorm) {
    cout << "NO";
    return 0;
  }
  for (std::map<int, int>::iterator it = str.begin(); it != str.end(); ++it) {
    res1.push_back(it->first);
    if (it->second == 2) res2.push_back(it->first);
  }
  cout << "YES\n";
  cout << res1.size() << '\n';
  sort(res1.begin(), res1.end());
  for (auto x : res1) cout << x << ' ';
  cout << '\n' << res2.size() << '\n';
  sort(res2.begin(), res2.end(), std::greater<int>());
  for (auto x : res2) cout << x << ' ';
  cout << endl;
  return 0;
}
