#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5;
vector<int> a[N];
int cmt[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    a[x].push_back(i);
  }
  int cnt = 0;
  for (int i = 1; i < 2005; i++) {
    if (a[i].size() > 1) cnt += a[i].size() - 1;
  }
  if (cnt > 1)
    puts("YES");
  else {
    puts("NO");
    return 0;
  }
  int k = 0;
  for (int t = 0; t < 3; t++) {
    for (int i = 1; i < N; i++) {
      for (int j = 0; j < a[i].size(); j++) printf("%d ", a[i][j]);
    }
    int p = 0;
    for (int i = 1; i < N; i++) {
      if (i > k && p < a[i].size() && a[i].size() > 1) {
        int temp = a[i][a[i].size() - 1];
        for (int j = a[i].size() - 2; j >= 0; j--) a[i][j + 1] = a[i][j];
        a[i][0] = temp;
        p++;
        if (p >= a[i].size() - 1) k = i;
        break;
      }
    }
    puts("");
  }
  return 0;
}
