#include <bits/stdc++.h>
using namespace std;
struct edge {
  int x;
  int id;
} a[2005];
bool cmp(edge m, edge n) { return m.x < n.x; }
int main() {
  int n, cou, ans1, ans2, i;
  while (scanf("%d", &n) != EOF) {
    for (i = 1; i <= n; i++) {
      scanf("%d", &a[i].x);
      a[i].id = i;
    }
    sort(a + 1, a + n + 1, cmp);
    cou = 0;
    ans1 = 0;
    ans2 = 0;
    for (i = 1; i < n; i++) {
      if ((a[i].x) == (a[i + 1].x)) {
        cou++;
        if (cou == 1) ans1 = i;
        if (cou == 2) {
          ans2 = i;
          break;
        }
      }
    }
    if (cou < 2)
      printf("NO\n");
    else {
      printf("YES\n");
      for (i = 1; i <= n; i++) printf("%d ", a[i].id);
      printf("\n");
      for (int i = 1; i < ans1; i++) printf("%d ", a[i].id);
      printf("%d %d ", a[ans1 + 1].id, a[ans1].id);
      for (int i = ans1 + 2; i <= n; i++) printf("%d ", a[i].id);
      printf("\n");
      for (int i = 1; i < ans2; i++) printf("%d ", a[i].id);
      printf("%d %d ", a[ans2 + 1].id, a[ans2].id);
      for (int i = ans2 + 2; i <= n; i++) printf("%d ", a[i].id);
      printf("\n");
    }
  }
  return 0;
}
