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