#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  pair<int, int> a[2016];
  vector<int> swaps;
  cin >> n;
  a[0].first = a[0].second = 0;
  for (i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n + 1);
  for (i = 1; i < n && swaps.size() < 2; i++)
    if (a[i].first == a[i + 1].first) swaps.push_back(i);
  if (swaps.size() == 2) {
    cout << "YES" << endl;
    for (i = 1; i <= n; i++) cout << a[i].second << ' ';
    cout << endl;
    swap(a[swaps[0]], a[swaps[0] + 1]);
    for (i = 1; i <= n; i++) cout << a[i].second << ' ';
    cout << endl;
    swap(a[swaps[1]], a[swaps[1] + 1]);
    for (i = 1; i <= n; i++) cout << a[i].second << ' ';
    cout << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
