#include <bits/stdc++.h>
using namespace std;
int a[2009];
map<int, int> cordMap;
int main() {
  int i, n;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    int c = a[i];
    a[i] = c * 10000 + i;
    cordMap.insert(pair<int, int>(a[i], i));
  }
  sort(a, a + n);
  int k = 0, x1 = 0, x2 = 0;
  i = 0;
  while (k < 2 & i < n - 1) {
    if (a[i] / 10000 == a[i + 1] / 10000) {
      k++;
      if (k == 1)
        x1 = i;
      else
        x2 = i;
    }
    i++;
  }
  if (k < 2) {
    printf("NO\n");
    return (0);
  };
  printf("YES\n");
  for (i = 0; i < n - 1; i++) printf("%d ", cordMap[a[i]] + 1);
  printf("%d\n", cordMap[a[n - 1]] + 1);
  swap(a[x1], a[x1 + 1]);
  for (i = 0; i < n - 1; i++) printf("%d ", cordMap[a[i]] + 1);
  printf("%d\n", cordMap[a[n - 1]] + 1);
  swap(a[x2], a[x2 + 1]);
  for (i = 0; i < n - 1; i++) printf("%d ", cordMap[a[i]] + 1);
  printf("%d\n", cordMap[a[n - 1]] + 1);
  return (0);
}
