#include <bits/stdc++.h>
using namespace std;
struct pack {
  int t, d;
  pack(int a, int b) {
    t = a;
    d = b;
  }
};
vector<pack> v;
bool comp(pack a, pack b) { return a.d < b.d; }
bool change[2010];
int in[2010];
int task[2010];
int out[2][2010];
int dif;
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int d;
    cin >> d;
    v.push_back(pack(i + 1, d));
  }
  sort(v.begin(), v.end(), comp);
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < n;) {
      out[i][j] = v[j].t;
      if (j < n - 1 && v[j].d == v[j + 1].d && !change[j] && dif == i) {
        out[i][j + 1] = v[j + 1].t;
        pack temp = v[j];
        v[j] = v[j + 1];
        v[j + 1] = temp;
        change[j] = true;
        j += 2;
        dif++;
      } else
        j++;
    }
    if (dif == i) break;
  }
  if (dif < 2) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < n; j++) {
      if (j) cout << " ";
      cout << out[i][j];
    }
    cout << endl;
  }
  for (int i = 0; i < n; i++) {
    if (i) cout << " ";
    cout << v[i].t;
  }
  cout << endl;
  return 0;
}
