#include <bits/stdc++.h>
using namespace std;
const int mx = 100010;
int main() {
  int n, x, cnt = 0, stop;
  vector<pair<int, int> > arr;
  map<int, int> visit;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    arr.push_back(make_pair(x, i + 1));
    visit[x]++;
    if (visit[x] > 1) cnt++;
    if (visit[x] > 2) cnt = 4;
  }
  if (cnt < 2)
    printf("NO\n");
  else {
    printf("YES\n");
    sort(arr.begin(), arr.end());
    visit.clear();
    for (int i = 0; i < 3; i++) {
      stop = 1;
      for (int j = 0; j < n; j++) {
        printf("%d", arr[j].second);
        if (j) {
          if (arr[j - 1].first == arr[j].first and visit[j - 1] == 0 and stop) {
            swap(arr[j - 1], arr[j]);
            visit[j - 1] = 1;
            stop = 0;
          }
        }
        if (j != n - 1) printf(" ");
      }
      printf("\n");
    }
  }
}
