#include <bits/stdc++.h>
using namespace std;
bool comp(pair<int, int> a, pair<int, int> b) {
  if (a.first == b.first)
    return a.second < b.second;
  else
    return a.first < b.first;
}
int main() {
  int n;
  pair<int, int> arr[2005];
  int frec[2005];
  memset(frec, 0, sizeof frec);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first;
    frec[arr[i].first]++;
    arr[i].second = i + 1;
  }
  sort(arr, arr + n, comp);
  int cont = 1;
  for (int i = 0; i < 2001; i++) {
    if (frec[i]) cont *= frec[i];
    if (cont >= 3) break;
  }
  if (cont >= 3) {
    puts("YES");
    for (int i = 0; i < n; i++) {
      if (i)
        cout << " " << arr[i].second;
      else
        cout << arr[i].second;
    }
    cout << endl;
    int prints = 1;
    for (int i = 0; i < n; i++) {
      if (frec[arr[i].first] >= 2) {
        if (i + 1 < n && arr[i].first == arr[i + 1].first) {
          swap(arr[i], arr[i + 1]);
          for (int j = 0; j < n; j++) {
            if (j)
              cout << " " << arr[j].second;
            else
              cout << arr[j].second;
          }
          cout << endl;
          prints++;
          swap(arr[i], arr[i + 1]);
          if (prints >= 3) break;
        }
      }
    }
  } else
    puts("NO");
  return 0;
}
