#include <bits/stdc++.h>
using namespace std;
struct flist {
  int pos;
  int val;
};
bool acomp(flist a, flist b) { return (a.val < b.val); }
using namespace std;
int main() {
  int i, j, k;
  int n;
  cin >> n;
  ;
  flist task[n + 1];
  for (i = 1; i < n + 1; i++) {
    cin >> j;
    ;
    task[i] = {i, j};
  }
  int duppos[2];
  int dupcount[2];
  memset(duppos, -1, sizeof(duppos));
  ;
  memset(dupcount, 0, sizeof(dupcount));
  ;
  int dup = 0;
  sort(task + 1, task + n + 1, acomp);
  bool fl = false;
  int count = 0;
  for (i = 1; i < n + 1; i++) {
    if (task[i].val == task[i - 1].val) {
      if (!fl) {
        count = 2;
        duppos[dup] = i - 1;
        fl = true;
      } else {
        count++;
      }
    } else {
      if (fl) {
        dupcount[dup] = count;
        count = 0;
        dup++;
        if (dup >= 2) {
          break;
        }
        fl = false;
      }
    }
  }
  if (fl && dup < 2) {
    dupcount[dup] = count;
    count = 0;
  }
  int fcount = 0;
  fcount += dupcount[0] + dupcount[1];
  if (fcount >= 3) {
    printf("YES\n");
    if (dupcount[0] > 2) {
      std::vector<int> temp;
      i = 1;
      while (i != duppos[0]) {
        printf("%d ", task[i].pos);
        i++;
      }
      printf("%d %d %d", task[duppos[0]].pos, task[duppos[0] + 1].pos,
             task[duppos[0] + 2].pos);
      i += 3;
      while (i < n + 1) {
        printf(" %d", task[i].pos);
        i++;
      }
      printf("\n");
      i = 1;
      while (i != duppos[0]) {
        printf("%d ", task[i].pos);
        i++;
      }
      printf("%d %d %d", task[duppos[0] + 1].pos, task[duppos[0]].pos,
             task[duppos[0] + 2].pos);
      i += 3;
      while (i < n + 1) {
        printf(" %d", task[i].pos);
        i++;
      }
      printf("\n");
      i = 1;
      while (i != duppos[0]) {
        printf("%d ", task[i].pos);
        i++;
      }
      printf("%d %d %d", task[duppos[0] + 2].pos, task[duppos[0] + 1].pos,
             task[duppos[0]].pos);
      i += 3;
      while (i < n + 1) {
        printf(" %d", task[i].pos);
        i++;
      }
      printf("\n");
    } else {
      i = 1;
      while (i != duppos[0]) {
        printf("%d ", task[i].pos);
        i++;
      }
      printf("%d %d ", task[duppos[0]].pos, task[duppos[0] + 1].pos);
      i += 2;
      while (i < n + 1) {
        printf("%d ", task[i].pos);
        i++;
      }
      printf("\n");
      i = 1;
      while (i != duppos[0]) {
        printf("%d ", task[i].pos);
        i++;
      }
      printf("%d %d ", task[duppos[0] + 1].pos, task[duppos[0]].pos);
      i += 2;
      while (i < n + 1) {
        printf("%d ", task[i].pos);
        i++;
      }
      printf("\n");
      i = 1;
      while (i != duppos[1]) {
        printf("%d ", task[i].pos);
        i++;
      }
      printf("%d %d ", task[duppos[1] + 1].pos, task[duppos[1]].pos);
      i += 2;
      while (i < n + 1) {
        printf("%d ", task[i].pos);
        i++;
      }
      printf("\n");
    }
  } else {
    printf("NO\n");
  }
}
