#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000 + 10;
pair<int, int> task[maxn];
int used[maxn];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int in, count = 0;
    memset(used, 0, sizeof(used));
    for (int i = 1; i <= n; i++) {
      scanf("%d", &in);
      task[i] = pair<int, int>(in, i);
      if (used[in]) count++;
      used[in]++;
    }
    if (count < 2)
      printf("NO\n");
    else {
      printf("YES\n");
      sort(task + 1, task + 1 + n);
      for (int time = 0; time < 3; time++) {
        for (int i = 1; i <= n; i++) printf("%d ", task[i].second);
        printf("\n");
        for (int i = 1; i < n; i++) {
          if (task[i].first == task[i + 1].first &&
              task[i].second < task[i + 1].second) {
            swap(task[i], task[i + 1]);
            break;
          }
        }
      }
    }
  }
  return 0;
}
