#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> h(n);
  for (int i = 0; i < n; i++) cin >> h[i];
  vector<pair<int, int> > v(n);
  for (int i = 0; i < n; i++) {
    v[i] = make_pair(h[i], i);
  }
  sort(v.begin(), v.end());
  sort(h.begin(), h.end());
  h.erase(unique(h.begin(), h.end()), h.end());
  if (n - h.size() < 2) {
    cout << "NO" << endl;
    return 0;
  } else {
    cout << "YES" << endl;
  }
  map<int, int> x;
  for (int i = 0; i + 1 < n; i++) {
    if (v[i].first == v[i + 1].first) {
      x[v[i].first] += 1;
    }
  }
  int type = x.size();
  for (int i = 0; i < 3; i++) {
    if (i == 0) {
      for (int j = 0; j < n; j++) {
        printf("%d ", v[j].second + 1);
      }
      printf("\n");
    } else {
      if (type == 1) {
        vector<pair<int, int> >::iterator it =
            lower_bound(v.begin(), v.end(), make_pair(x.begin()->first, -1));
        swap(v[it - v.begin()], v[it - v.begin() + i]);
        for (int j = 0; j < n; j++) {
          printf("%d ", v[j].second + 1);
        }
        printf("\n");
      } else {
        vector<pair<int, int> >::iterator it =
            lower_bound(v.begin(), v.end(), make_pair(x.begin()->first, -1));
        x.erase(x.begin());
        swap(v[it - v.begin()], v[it - v.begin() + 1]);
        for (int j = 0; j < n; j++) {
          printf("%d ", v[j].second + 1);
        }
        printf("\n");
      }
    }
  }
  return 0;
}
