#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dy[] = {-1, 1, 0, 0, -1, -1, 1, 1};
int n, m;
int main() {
  cin >> n;
  vector<pair<int, int> > v;
  for (int i = 1; i <= n; ++i) {
    cin >> m;
    v.push_back(make_pair(m, i));
  }
  sort(v.begin(), v.end());
  vector<vector<pair<int, int> > > q;
  q.push_back(v);
  int x, y;
  for (int i = 0; i < v.size() - 1; ++i) {
    if (v[i].first == v[i + 1].first) {
      x = v[i].first;
      y = v[i].second;
      v[i].first = v[i + 1].first;
      v[i].second = v[i + 1].second;
      v[i + 1].first = x;
      v[i + 1].second = y;
      q.push_back(v);
    }
  }
  if (q.size() < 3)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int i = 0; i < 3; ++i) {
      for (int j = 0; j < q[i].size(); ++j) {
        cout << q[i][j].second << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
