#include <bits/stdc++.h>
using namespace std;
struct node {
  int a;
  int m;
};
bool acompare(node lhs, node rhs) { return lhs.a < rhs.a; }
int main() {
  int n;
  cin >> n;
  node arr[n], marker[n];
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    arr[i - 1].a = a;
    arr[i - 1].m = i;
  }
  std::sort(arr, arr + n, acompare);
  int arr1[n];
  int arr2[n];
  int arr3[n];
  int flag_one = 1;
  int count = 0;
  for (int i = 1; i < n; i++) {
    if (arr[i - 1].a == arr[i].a) {
      count++;
      if (flag_one) {
        flag_one = 0;
        for (int j = 0; j < n; j++) {
          arr1[j] = arr[j].m;
        }
        int t;
        t = arr[i].m;
        arr[i].m = arr[i - 1].m;
        arr[i - 1].m = t;
        for (int j = 0; j < n; j++) {
          arr2[j] = arr[j].m;
        }
        t = arr[i - 1].m;
        arr[i - 1].m = arr[i].m;
        arr[i].m = t;
      } else {
        int t = arr[i - 1].m;
        arr[i - 1].m = arr[i].m;
        arr[i].m = t;
        for (int j = 0; j < n; j++) {
          arr3[j] = arr[j].m;
        }
      }
    }
    if (count == 2) {
      cout << "YES\n";
      for (int j = 0; j < n; j++) cout << arr1[j] << " ";
      cout << "\n";
      for (int j = 0; j < n; j++) cout << arr2[j] << " ";
      cout << "\n";
      for (int j = 0; j < n; j++) cout << arr3[j] << " ";
      cout << "\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
