#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  std::vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(make_pair(x, i + 1));
  }
  sort(v.begin(), v.end());
  int total = 1;
  int i1 = -1, j1 = -1;
  int i2 = -1, j2 = -1;
  for (int i = 0; i < n;) {
    int j = i + 1;
    while (j < n && v[j].first == v[i].first) j++;
    total *= (j - i);
    if (j - i >= 2) {
      if (i1 == -1) {
        i1 = i;
        j1 = j;
      } else {
        i2 = i;
        j2 = j;
      }
    }
    if (total >= 3) break;
    i = j;
  }
  if (total < 3) {
    cout << "NO";
    return 0;
  }
  std::vector<int> ans[3];
  for (int i = 0; i < i1; i++) {
    ans[0].push_back(v[i].second);
    ans[1].push_back(v[i].second);
    ans[2].push_back(v[i].second);
  }
  if (j1 - i1 >= 3) {
    ans[0].push_back(v[i1].second);
    ans[1].push_back(v[i1 + 1].second);
    ans[2].push_back(v[i1 + 2].second);
    ans[0].push_back(v[i1 + 1].second);
    ans[1].push_back(v[i1].second);
    ans[2].push_back(v[i1 + 1].second);
    ans[0].push_back(v[i1 + 2].second);
    ans[1].push_back(v[i1 + 2].second);
    ans[2].push_back(v[i1].second);
    for (int i = i1 + 3; i < n; i++) {
      ans[0].push_back(v[i].second);
      ans[1].push_back(v[i].second);
      ans[2].push_back(v[i].second);
    }
  } else {
    ans[0].push_back(v[i1].second);
    ans[1].push_back(v[i1].second);
    ans[2].push_back(v[i1 + 1].second);
    ans[0].push_back(v[i1 + 1].second);
    ans[1].push_back(v[i1 + 1].second);
    ans[2].push_back(v[i1].second);
    for (int i = i1 + 2; i < i2; i++) {
      ans[0].push_back(v[i].second);
      ans[1].push_back(v[i].second);
      ans[2].push_back(v[i].second);
    }
    ans[0].push_back(v[i2].second);
    ans[1].push_back(v[i2 + 1].second);
    ans[2].push_back(v[i2].second);
    ans[0].push_back(v[i2 + 1].second);
    ans[1].push_back(v[i2].second);
    ans[2].push_back(v[i2 + 1].second);
    for (int i = i2 + 2; i < n; i++) {
      ans[0].push_back(v[i].second);
      ans[1].push_back(v[i].second);
      ans[2].push_back(v[i].second);
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << ans[0][i] << ' ';
  cout << endl;
  for (int i = 0; i < n; i++) cout << ans[1][i] << ' ';
  cout << endl;
  for (int i = 0; i < n; i++) cout << ans[2][i] << ' ';
  return 0;
}
