#include <bits/stdc++.h>
namespace ProblemC {
using namespace std;
class Solution {
 public:
  void TwoShuffledSequences() {
    int numElements;
    cin >> numElements;
    vector<int> elements(numElements);
    for (int& e : elements) {
      cin >> e;
    }
    sort(elements.begin(), elements.end());
    vector<int> increasingSequence = {elements[0]};
    vector<int> decreasingSequence;
    int count = 1;
    for (int i = 1; i < elements.size(); ++i) {
      if (elements[i] == elements[i - 1]) {
        ++count;
      } else {
        count = 1;
      }
      if (count == 3) {
        cout << "NO";
        return;
      } else if (count == 2) {
        decreasingSequence.push_back(elements[i]);
      } else {
        increasingSequence.push_back(elements[i]);
      }
    }
    cout << "YES" << endl;
    cout << increasingSequence.size() << endl;
    for (int e : increasingSequence) {
      cout << e << ' ';
    }
    cout << endl;
    cout << decreasingSequence.size() << endl;
    for (auto e = decreasingSequence.rbegin(); e != decreasingSequence.rend();
         ++e) {
      cout << *e << ' ';
    }
    cout << endl;
  }
};
}  // namespace ProblemC
int main() {
  ProblemC::Solution s;
  s.TwoShuffledSequences();
}
