#include <bits/stdc++.h>
using namespace std;
int haha[2500];
struct Point {
  int diff;
  int index;
};
Point p[2500];
bool cmp(Point a, Point b) { return a.diff < b.diff; }
int main() {
  memset(haha, 0, sizeof(haha));
  int num;
  scanf("%d", &num);
  for (int i = 0; i < num; ++i) {
    scanf("%d", &p[i].diff);
    ++haha[p[i].diff];
    p[i].index = i;
  }
  sort(p, p + num, cmp);
  int result = 1;
  for (int i = 0; i <= 2000; ++i) {
    if (haha[i]) {
      result *= haha[i];
    }
    if (result >= 3) {
      printf("YES\n");
      break;
    }
  }
  if (result < 3) {
    printf("NO\n");
  } else {
    int cnt = 1;
    for (int j = 0; j < num - 1; ++j) {
      printf("%d ", p[j].index + 1);
    }
    printf("%d\n", p[num - 1].index + 1);
    for (int i = 0; i < num - 1; ++i) {
      if (p[i].diff == p[i + 1].diff) {
        for (int j = 0; j < i; ++j) {
          printf("%d ", p[j].index + 1);
        }
        printf("%d %d", p[i + 1].index + 1, p[i].index + 1);
        for (int j = i + 2; j < num; ++j) {
          printf(" %d", p[j].index + 1);
        }
        printf("\n");
        ++cnt;
      }
      if (cnt >= 3) {
        break;
      }
    }
  }
}
