#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > b;
vector<int> c;
int x;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    b.push_back(make_pair(x, i + 1));
  }
  sort(b.begin(), b.end());
  int k = 1;
  for (int i = 0; i < b.size(); i++) {
    if (b[i].first == b[i + 1].first) {
      k++;
      c.push_back(i);
    }
  }
  if (k < 3) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 0; i < b.size(); i++) cout << b[i].second << ' ';
  cout << endl;
  swap(b[c[0]], b[c[0] + 1]);
  for (int i = 0; i < b.size(); i++) cout << b[i].second << ' ';
  cout << endl;
  swap(b[c[0]], b[c[0] + 1]);
  swap(b[c[1]], b[c[1] + 1]);
  for (int i = 0; i < b.size(); i++) cout << b[i].second << ' ';
  cout << endl;
  return 0;
}
