#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    vector<pair<int, int> > v(n, pair<int, int>());
    vector<bool> B(n, 1);
    map<int, int> M;
    int c = 0;
    for (int i = 0; i < n; i++) {
      int a;
      cin >> a;
      v[i] = pair<int, int>(a, i);
      M[a]++;
      if (M[a] > 1) c++;
    }
    if (c < 2) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    bool sw = 1;
    int p;
    sort(v.begin(), v.end());
    for (int i = 0; i < n; i++) cout << v[i].second + 1 << " ";
    cout << endl;
    for (int i = 0; i < n; i++) {
      if (i > 0)
        if (v[i].first == v[i - 1].first and B[i] and sw) {
          swap(v[i].second, v[i - 1].second);
          B[i] = 0;
          sw = 0;
          p = i;
        }
    }
    for (int i = 0; i < n; i++) cout << v[i].second + 1 << " ";
    cout << endl;
    swap(v[p].second, v[p - 1].second);
    sw = 1;
    for (int i = 0; i < n; i++) {
      if (i > 0)
        if (v[i].first == v[i - 1].first and B[i]) {
          swap(v[i].second, v[i - 1].second);
          B[i] = 0;
          sw = 0;
          p = i;
        }
    }
    for (int i = 0; i < n; i++) cout << v[i].second + 1 << " ";
    cout << endl;
  }
  return 0;
}
