#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = i;
  }
  for (int i = n - 1; i > 0; i--)
    for (int j = 0; j < i; j++)
      if (a[j] > a[j + 1]) {
        swap(a[j], a[j + 1]);
        swap(b[j], b[j + 1]);
      }
  int s = 0;
  vector<int> f;
  for (int i = 1; i < n; i++) {
    if (a[i] == a[i - 1] && s == 1) {
      s = 2;
      f.push_back(i);
      break;
    }
    if (a[i] == a[i - 1]) {
      s++;
      f.push_back(i);
    }
    if (s == 2) break;
  }
  if (s != 2) {
    cout << "NO";
  } else {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) cout << b[i] + 1 << " ";
    cout << endl;
    swap(b[f[0]], b[f[0] - 1]);
    for (int i = 0; i < n; i++) cout << b[i] + 1 << " ";
    cout << endl;
    swap(b[f[1]], b[f[1] - 1]);
    for (int i = 0; i < n; i++) cout << b[i] + 1 << " ";
    cout << endl;
  }
}
