#include <bits/stdc++.h>
using namespace std;
int arr[2005];
int place[2005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    place[i] = i + 1;
  }
  for (int x = 0; x < n; x++) {
    for (int y = 0; y < n - 1; y++) {
      if (arr[y] > arr[y + 1]) {
        int temp = arr[y + 1];
        arr[y + 1] = arr[y];
        arr[y] = temp;
        int tamp = place[y + 1];
        place[y + 1] = place[y];
        place[y] = tamp;
      }
    }
  }
  int tamp = arr[0];
  int f1, f2, f3;
  f1 = f2 = f3 = -1;
  int last;
  int last1, last2;
  for (int i = 0; i < n; i++) {
    tamp = arr[i];
    if (i + 1 < n && arr[i + 1] == tamp && i + 2 < n && arr[i + 2] == tamp) {
      f1 = 1;
      last = i;
      break;
    }
    if (f2 == -1 && i + 1 < n && arr[i + 1] == tamp) {
      f2 = 1;
      last1 = i;
    } else if (f2 == 1 && i + 1 < n && arr[i + 1] == tamp) {
      f3 = 1;
      last2 = i;
    }
  }
  if (f1 == 1) {
    cout << "YES\n";
    for (int i = 0; i < n - 1; i++) {
      cout << place[i] << " ";
    }
    cout << place[n - 1] << "\n";
    int temp = place[last];
    place[last] = place[last + 1];
    place[last + 1] = temp;
    last++;
    for (int i = 0; i < n - 1; i++) {
      cout << place[i] << " ";
    }
    cout << place[n - 1] << "\n";
    temp = place[last];
    place[last] = place[last + 1];
    place[last + 1] = temp;
    last++;
    for (int i = 0; i < n - 1; i++) {
      cout << place[i] << " ";
    }
    cout << place[n - 1] << "\n";
  } else if (f3 == 1) {
    cout << "YES\n";
    for (int i = 0; i < n - 1; i++) {
      cout << place[i] << " ";
    }
    cout << place[n - 1] << "\n";
    int temp = place[last1];
    place[last1] = place[last1 + 1];
    place[last1 + 1] = temp;
    for (int i = 0; i < n - 1; i++) {
      cout << place[i] << " ";
    }
    cout << place[n - 1] << "\n";
    temp = place[last2];
    place[last2] = place[last2 + 1];
    place[last2 + 1] = temp;
    for (int i = 0; i < n - 1; i++) {
      cout << place[i] << " ";
    }
    cout << place[n - 1] << "\n";
  } else {
    cout << "NO\n";
  }
}
