#include <bits/stdc++.h>
using namespace std;
int main() {
  bool f = true;
  int n, ans = 0;
  cin >> n;
  vector<pair<int, int> > d(n);
  for (int i = 0; i < n; i++) {
    cin >> d[i].first;
    d[i].second = i + 1;
  }
  sort(d.begin(), d.end());
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (d[j].first == d[i].first) ans++;
    }
  }
  if ((ans * 2) < 3) {
    cout << "NO" << endl;
    return 0;
  } else {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      cout << d[i].second << " ";
    }
    cout << endl;
    for (int i = 0; i < n - 1 && f; i++)
      if (d[i].first == d[i + 1].first) {
        swap(d[i].second, d[i + 1].second);
        d[i].first += 1;
        f = false;
      }
    for (int i = 0; i < n; i++) {
      cout << d[i].second << " ";
    }
    cout << endl;
    for (int i = 0; i < n - 1; i++)
      if (d[i].first == d[i + 1].first) {
        swap(d[i].second, d[i + 1].second);
      }
    for (int i = 0; i < n; i++) {
      cout << d[i].second << " ";
    }
    cout << endl;
  }
  return 0;
}
