#include <bits/stdc++.h>
using namespace std;
struct task {
  int num;
  int value;
  task(int a, int b) : num(a), value(b) {}
};
struct less_than_key {
  inline bool operator()(const task& struct1, const task& struct2) {
    return (struct1.value < struct2.value);
  }
};
void solve() {
  vector<task> vec;
  int n;
  cin >> n;
  int pom;
  int a[2002], possib = 1;
  for (int i = 0; i < 2002; i++) a[i] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> pom;
    vec.push_back(task(i, pom));
    a[pom] += 1;
  }
  for (int i = 1; i < 2002; i++) {
    if (a[i] != 0 and possib < 10) {
      possib *= a[i];
    }
    if (possib >= 10) break;
  }
  if (possib >= 3)
    cout << "YES" << endl;
  else {
    cout << "NO" << endl;
    return;
  }
  sort(vec.begin(), vec.end(), less_than_key());
  for (int i = 0; i < 2002; i++) a[i] = 0;
  int k = 1;
  int b[2002], a1[2002];
  for (vector<task>::iterator it = vec.begin(); it != vec.end(); it++) {
    a[k] = it->num;
    a1[k] = it->num;
    b[k] = it->value;
    k++;
  }
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
  k = 1;
  int pomm;
  while (k + 1 <= n) {
    if (b[k] == b[k + 1]) {
      pomm = a[k];
      a[k] = a[k + 1];
      a[k + 1] = pomm;
      k++;
      break;
    }
    k++;
  }
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
  while (k + 1 <= n) {
    if (b[k] == b[k + 1]) {
      pom = a1[k];
      a1[k] = a1[k + 1];
      a1[k + 1] = pom;
      break;
    }
    k++;
  }
  for (int i = 1; i <= n; i++) {
    cout << a1[i] << " ";
  }
  cout << endl;
}
int main() { solve(); }
