#include <bits/stdc++.h>
using namespace std;
int con[2005];
int main() {
  int n, i, l, t = 0, x1, x2, c1, v1, c2, v2, x;
  pair<int, int> a[2005];
  x1 = x2 = -1;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    a[i] = make_pair(x, i + 1);
    con[x]++;
    if (t < 2) {
      if (con[x] >= 2) {
        t++;
        if (x1 == -1)
          x1 = x;
        else
          x2 = x;
      }
    }
  }
  if (t < 2) {
    printf("NO");
    return 0;
  }
  c1 = c2 = v1 = v2 = -1;
  sort(a, a + n);
  for (i = 0; i < n; i++) {
    if (c1 == -1 && a[i].first == x1)
      c1 = i;
    else if (v1 == -1 && a[i].first == x1)
      v1 = i;
    else if (c2 == -1 && a[i].first == x2)
      c2 = i;
    else if (v2 == -1 && a[i].first == x2)
      v2 = i;
  }
  if (v2 == -1) v2 = c1;
  printf("YES\n");
  for (i = 0; i < n; i++) printf("%d ", a[i].second);
  puts("");
  swap(a[c1], a[v1]);
  for (i = 0; i < n; i++) printf("%d ", a[i].second);
  puts("");
  swap(a[c1], a[v1]);
  swap(a[c2], a[v2]);
  for (i = 0; i < n; i++) printf("%d ", a[i].second);
  puts("");
  return 0;
}
