#include <bits/stdc++.h>
using namespace std;
int f[2001], order[2001][3];
int main() {
  int n;
  vector<pair<int, int> > foo;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int h;
    cin >> h;
    f[h]++;
    foo.push_back(make_pair(h, i + 1));
  }
  sort(foo.begin(), foo.end());
  int twoC = 0, thrC = 0, isPos = 0, dif3 = 0;
  for (int i = 0; i < 2001; i++)
    if (f[i] >= 3) {
      thrC++;
      dif3 = i;
    } else if (f[i] == 2) {
      twoC++;
    }
  if (thrC || twoC >= 2) isPos = 1;
  if (isPos) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      order[i][0] = order[i][1] = order[i][2] = foo[i].second;
    }
    if (thrC) {
      for (int i = 0; i < n; i++)
        if (foo[i].first == dif3) {
          swap(order[i][1], order[i + 1][1]);
          swap(order[i + 1][2], order[i + 2][2]);
          break;
        }
    } else {
      int bar = 0;
      for (int i = 0; i < n - 1; i++)
        if (foo[i].first == foo[i + 1].first) {
          if (!bar) {
            swap(order[i][1], order[i + 1][1]);
            bar = 1;
          } else {
            swap(order[i][2], order[i + 1][2]);
            break;
          }
        }
    }
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < n; j++) cout << order[j][i] << " ";
      cout << "\n";
    }
  } else
    cout << "NO\n";
  return 0;
}
