#include <bits/stdc++.h>
using namespace std;
struct business {
  int num;
  int dif;
};
bool compare(business x, business y) { return (x.dif < y.dif); }
int main() {
  int n;
  int x;
  cin >> n;
  vector<business> A(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> x;
    A[i].num = i;
    A[i].dif = x;
  }
  sort(A.begin(), A.end(), compare);
  int triple = 0, p1 = 0, p2 = 0;
  for (int i = 1; i < n; i++) {
    if (A[i].dif == A[i + 1].dif)
      if (p1 == 0) {
        p1 = i;
        if (i <= n - 2)
          if (A[i + 1].dif == A[i + 2].dif) {
            triple = i;
            break;
          }
      } else {
        p2 = i;
        if (i <= n - 2)
          if (A[i + 1].dif == A[i + 2].dif) triple = i;
        break;
      }
  }
  if ((triple == 0) && (p2 == 0))
    cout << "NO\n";
  else {
    cout << "YES\n";
    if (triple != 0) {
      for (int i = 1; i <= n; i++) cout << A[i].num << " ";
      cout << endl;
      for (int i = 1; i <= n; i++) {
        if (i == triple) {
          cout << A[i].num << " " << A[i + 2].num << " " << A[i + 1].num << " ";
          i += 2;
        } else
          cout << A[i].num << " ";
      }
      cout << endl;
      for (int i = 1; i <= n; i++) {
        if (i == triple) {
          cout << A[i + 2].num << " " << A[i + 1].num << " " << A[i].num << " ";
          i += 2;
        } else
          cout << A[i].num << " ";
      }
      cout << endl;
    } else {
      for (int i = 1; i <= n; i++) cout << A[i].num << " ";
      cout << endl;
      for (int i = 1; i <= n; i++) {
        if (i == p1) {
          cout << A[i + 1].num << " " << A[i].num << " ";
          i++;
        } else
          cout << A[i].num << " ";
      }
      cout << endl;
      for (int i = 1; i <= n; i++) {
        if (i == p2) {
          cout << A[i + 1].num << " " << A[i].num << " ";
          i++;
        } else
          cout << A[i].num << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
