#include <bits/stdc++.h>
using namespace std;
int n, i, b[10001], ans, ans1, k, j, s, l, y;
pair<int, int> a[10001];
bool u[10001];
int main() {
  s = 1;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n);
  for (i = 0; i < n; i++) b[a[i].first]++;
  for (i = 0; i <= 2000; i++) {
    if (b[i] >= 2) s *= b[i];
    if (s > 2) break;
  }
  if (s >= 3) {
    cout << "YES" << endl;
    for (k = 0; k < 3; k++) {
      for (i = 0; i < n; i++) {
        cout << a[i].second + 1 << ' ';
      }
      for (l = 0; l < n; l++) {
        if (!u[l] && a[l].first == a[l + 1].first) {
          swap(a[l], a[l + 1]);
          u[l] = true;
          y++;
          break;
        }
      }
      cout << endl;
    }
  } else
    cout << "NO";
  return 0;
}
