#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, temp, ar1[2010], ar2[2010], con[2010], i = 1, c = 0, c1 = 0, j, pos;
  for (i = 1; i <= 2010; i++) con[i] = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &ar1[i]);
    ar2[i] = i;
    con[ar1[i]] += 1;
  }
  for (i = 1; i <= 2010; i++) {
    if (con[i] > 1) c += 1;
    if (con[i] > 2) {
      c1 = 1;
      break;
    }
  }
  if ((c < 2) && (c1 == 0))
    printf("NO");
  else if ((c >= 2) || (c1 = 1)) {
    printf("YES\n");
    for (i = 1; i <= n; i++) {
      for (j = i; j <= n; j++) {
        if (ar1[i] > ar1[j]) {
          temp = ar1[i];
          ar1[i] = ar1[j];
          ar1[j] = temp;
          temp = ar2[i];
          ar2[i] = ar2[j];
          ar2[j] = temp;
        }
      }
    }
    for (i = 1; i <= n; i++) printf("%d ", ar2[i]);
    printf("\n");
    for (j = 1; j < n; j++) {
      if (ar1[j] == ar1[j + 1]) {
        pos = j + 1;
        temp = ar2[j];
        ar2[j] = ar2[j + 1];
        ar2[j + 1] = temp;
        break;
      }
    }
    for (i = 1; i <= n; i++) printf("%d ", ar2[i]);
    printf("\n");
    for (j = pos; j <= n; j++) {
      if (ar1[j] == ar1[j + 1]) {
        temp = ar2[j];
        ar2[j] = ar2[j + 1];
        ar2[j + 1] = temp;
        break;
      }
    }
    for (i = 1; i <= n; i++) printf("%d ", ar2[i]);
  }
}
