#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
} a[2010];
int cmp(node x, node y) { return x.x < y.x; }
node a1[2010], a2[2010], a3[2010];
int main() {
  int m, n, i, j, k;
  while (scanf("%d", &n) != -1) {
    memset(a, 0, sizeof(a));
    for (i = 1; i <= n; i++) {
      scanf("%d", &a[i].x);
      a[i].y = i;
    }
    sort(a + 1, a + 1 + n, cmp);
    for (i = 1; i <= n; i++) {
      a1[i].y = a[i].y;
      a1[i].x = a[i].x;
    }
    int flag = 0;
    for (i = 1; i <= n; i++) {
      if (a1[i].x == a1[i + 1].x && !flag) {
        k = i;
        flag = 1;
        a2[i].y = a1[i + 1].y;
        a2[i + 1].y = a1[i].y;
        i++;
        continue;
      }
      a2[i].x = a1[i].x;
      a2[i].y = a1[i].y;
    }
    if (flag == 0) {
      printf("NO\n");
      continue;
    }
    for (i = 1; i <= n; i++) {
      if (a1[i].x == a1[i + 1].x && i != k && flag == 1) {
        flag = 2;
        a3[i].y = a1[i + 1].y;
        a3[i + 1].y = a1[i].y;
        i++;
        continue;
      }
      a3[i].y = a1[i].y;
    }
    if (flag != 2) {
      printf("NO\n");
      continue;
    }
    printf("YES\n");
    for (i = 1; i <= n; i++)
      if (i == 1)
        printf("%d", a1[i].y);
      else
        printf(" %d", a1[i].y);
    printf("\n");
    for (i = 1; i <= n; i++)
      if (i == 1)
        printf("%d", a2[i].y);
      else
        printf(" %d", a2[i].y);
    printf("\n");
    for (i = 1; i <= n; i++)
      if (i == 1)
        printf("%d", a3[i].y);
      else
        printf(" %d", a3[i].y);
    printf("\n");
  }
  return 0;
}
