#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > vii;
vector<pair<int, int> > swp;
int main() {
  int i, j, k;
  int n, m;
  scanf("%d", &n);
  for (i = 0; i < (n); ++i) {
    int x;
    scanf("%d", &x);
    vii.push_back(make_pair(x, i + 1));
  }
  sort(vii.begin(), vii.end());
  for (i = 0; i < (n - 1); ++i)
    if (vii[i].first == vii[i + 1].first) swp.push_back(make_pair(i, i + 1));
  if ((int)swp.size() < 2)
    printf("NO\n");
  else {
    printf("YES\n");
    for (i = 0; i < (n); ++i)
      printf("%d%c", vii[i].second, i != n - 1 ? ' ' : '\n');
    swap(vii[swp[0].first], vii[swp[0].second]);
    for (i = 0; i < (n); ++i)
      printf("%d%c", vii[i].second, i != n - 1 ? ' ' : '\n');
    swap(vii[swp[1].first], vii[swp[1].second]);
    for (i = 0; i < (n); ++i)
      printf("%d%c", vii[i].second, i != n - 1 ? ' ' : '\n');
  }
  return 0;
}
