#include <bits/stdc++.h>
using namespace std;
int n;
vector<pair<int, int> > diffs;
int t1, t2;
void print() {
  cout << diffs[0].second;
  for (int i = 1; i < n; i++) {
    cout << " " << diffs[i].second;
  }
  cout << "\n";
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t1;
    diffs.push_back(pair<int, int>(t1, i + 1));
  }
  sort(diffs.begin(), diffs.end());
  vector<pair<int, int> > swaps;
  int cnt = 0;
  for (int i = 1; i < n; i++) {
    if (diffs[i].first == diffs[i - 1].first) {
      swaps.push_back(pair<int, int>(i, i - 1));
      cnt++;
      if (cnt == 2) break;
    }
  }
  if (cnt < 2) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    print();
    for (int i = 0; i < 2; i++) {
      swap(diffs[swaps[i].first], diffs[swaps[i].second]);
      print();
    }
  }
  return 0;
}
