#include <bits/stdc++.h>
using namespace std;
const int N = 1000 * 2 + 33;
vector<int> ary[N];
int main() {
  int n;
  cin >> n;
  int ch = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    ary[a].push_back(i + 1);
    if (ary[a].size() > 2) ch = 3;
    if (ary[a].size() == 2) ch++;
  }
  if (ch > 1) {
    cout << "YES" << endl;
    vector<int> v[3];
    int t = 0;
    for (int i = 0; i < N; i++) {
      if (ary[i].size() == 2) {
        v[t % 3].push_back(ary[i][0]);
        v[t % 3].push_back(ary[i][1]);
        v[(t + 1) % 3].push_back(ary[i][0]);
        v[(t + 1) % 3].push_back(ary[i][1]);
        v[(t + 2) % 3].push_back(ary[i][1]);
        v[(t + 2) % 3].push_back(ary[i][0]);
        t++;
      } else if (ary[i].size() > 2) {
        v[0].push_back(ary[i][0]);
        v[0].push_back(ary[i][1]);
        v[0].push_back(ary[i][2]);
        v[1].push_back(ary[i][1]);
        v[1].push_back(ary[i][2]);
        v[1].push_back(ary[i][0]);
        v[2].push_back(ary[i][2]);
        v[2].push_back(ary[i][0]);
        v[2].push_back(ary[i][1]);
        for (int j = 3; j < ary[i].size(); j++) {
          v[0].push_back(ary[i][j]);
          v[1].push_back(ary[i][j]);
          v[2].push_back(ary[i][j]);
        }
      } else {
        for (int j = 0; j < ary[i].size(); j++) {
          v[0].push_back(ary[i][j]);
          v[1].push_back(ary[i][j]);
          v[2].push_back(ary[i][j]);
        }
      }
    }
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < n; j++) cout << v[i][j] << " ";
      cout << endl;
    }
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
