#include <bits/stdc++.h>
using namespace std;
pair<int, int> b[1000000];
int a[100000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i].first = a[i];
    b[i].second = i;
  }
  sort(b, b + n);
  int t1, t2, u1, u2, l = 0, w = 0;
  for (int i = 1; i < n; i++) {
    if (b[i].first == b[i - 1].first) {
      if (l == 0) {
        t1 = i - 1;
        t2 = i;
        l++;
      } else if (l == 1) {
        u1 = i - 1;
        u2 = i;
        w = 1;
        break;
      }
    }
  }
  if (w == 1) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      cout << b[i].second + 1 << " ";
    }
    cout << endl;
    swap(b[t1].second, b[t2].second);
    for (int i = 0; i < n; i++) {
      cout << b[i].second + 1 << " ";
    }
    cout << endl;
    swap(b[u1].second, b[u2].second);
    for (int i = 0; i < n; i++) {
      cout << b[i].second + 1 << " ";
    }
    cout << endl;
    swap(b[t1].second, b[t2].second);
    return 0;
  }
  cout << "NO";
}
