#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, id;
};
node a[2005];
vector<int> x[2005];
int n, num, cnt, FLAG11, FLAG12, FLAG2, CNT = 1;
bool flag11, flag12, flag2;
bool cmp(node a, node b) { return a.x < b.x; }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i].x);
    a[i].id = i;
  }
  sort(a, a + n, cmp);
  x[num].push_back(a[0].id);
  for (int i = 1; i < n; ++i) {
    if (a[i].x != a[i - 1].x) {
      ++num;
      cnt = 0;
      x[num].push_back(a[i].id);
    } else {
      ++cnt;
      x[num].push_back(a[i].id);
    }
  }
  ++num;
  for (int i = 0; i < num; ++i) {
    {
      if (x[i].size() > 2) {
        flag2 = true;
        FLAG2 = i;
      } else if (x[i].size() > 1) {
        if (flag11) {
          flag12 = true;
          FLAG12 = i;
        } else {
          flag11 = true;
          FLAG11 = i;
        }
      }
    }
  }
  if (flag2 || (flag11 && flag12)) {
    printf("YES\n");
    if (flag2) {
      for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < num; ++j) {
          int cnt = x[j].size();
          for (int k = 0; k < cnt; ++k) printf("%d ", x[j][k] + 1);
          if (j == FLAG2) next_permutation(x[j].begin(), x[j].end());
        }
        printf("\n");
      }
    } else {
      for (int i = 0; i < num; ++i) {
        int cnt = x[i].size();
        for (int j = 0; j < cnt; ++j) printf("%d ", x[i][j] + 1);
        if (i == FLAG11) next_permutation(x[i].begin(), x[i].end());
      }
      printf("\n");
      for (int i = 0; i < num; ++i) {
        int cnt = x[i].size();
        for (int j = 0; j < cnt; ++j) printf("%d ", x[i][j] + 1);
        if (i == FLAG12) next_permutation(x[i].begin(), x[i].end());
      }
      printf("\n");
      for (int i = 0; i < num; ++i) {
        int cnt = x[i].size();
        for (int j = 0; j < cnt; ++j) printf("%d ", x[i][j] + 1);
      }
      printf("\n");
    }
  } else
    printf("NO\n");
  return 0;
}
