#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> h(n);
  for (auto &x : h) cin >> x;
  vector<pair<int, int> > p, q, r;
  for (int i = 1; i <= n; i++) {
    p.push_back(make_pair(h[i - 1], i));
    q.push_back(make_pair(h[i - 1], i));
    r.push_back(make_pair(h[i - 1], i));
  }
  sort(p.begin(), p.end());
  sort(q.begin(), q.end());
  sort(r.begin(), r.end());
  int flag;
  for (int i = 0; i < n; i++) {
    flag = 0;
    for (int j = i + 1; j < n; j++) {
      if (p[i].first == p[j].first) {
        pair<int, int> t = q[i];
        q[i] = q[j];
        q[j] = t;
        flag = 1;
        p[j].first = -1;
        break;
      }
    }
    if (flag == 1) break;
  }
  if (flag == 0) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    flag = 0;
    for (int j = i + 1; j < n; j++) {
      if (p[i].first == p[j].first) {
        pair<int, int> t = r[i];
        r[i] = r[j];
        r[j] = t;
        flag = 1;
        break;
      }
    }
    if (flag == 1) break;
  }
  if (flag == 0) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  for (auto x : p) {
    cout << x.second << " ";
  }
  cout << endl;
  for (auto x : q) {
    cout << x.second << " ";
  }
  cout << endl;
  for (auto x : r) {
    cout << x.second << " ";
  }
  cout << endl;
}
