#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<pair<int, int> > h;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    h.push_back(make_pair(x, i + 1));
  }
  sort(h.begin(), h.end());
  int count = 0;
  vector<int> rep;
  for (int i = 0; i < n - 1; i++) {
    if (h[i].first == h[i + 1].first) {
      count++;
      rep.push_back(i);
    }
    if (count > 1) break;
  }
  if (count < 2)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 0; i < n; i++) printf("%d ", h[i].second);
    printf("\n");
    for (int i = 0; i < rep[0]; i++) printf("%d ", h[i].second);
    printf("%d %d ", h[rep[0] + 1].second, h[rep[0]].second);
    for (int i = rep[0] + 2; i < n; i++) printf("%d ", h[i].second);
    printf("\n");
    for (int i = 0; i < rep[1]; i++) printf("%d ", h[i].second);
    printf("%d %d ", h[rep[1] + 1].second, h[rep[1]].second);
    for (int i = rep[1] + 2; i < n; i++) printf("%d ", h[i].second);
  }
  return 0;
}
