#include <bits/stdc++.h>
using namespace std;
struct node {
  int num, a;
} a[2001];
bool cmp(const node &x, const node &y) { return x.a < y.a; }
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].a, a[i].num = i;
  sort(a + 1, a + n + 1, cmp);
  int cnt = 0;
  for (int i = 2; i <= n; i++)
    if (a[i].a == a[i - 1].a) cnt++;
  if (cnt < 2) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << a[i].num << " ";
  cout << endl;
  for (int i = 2; i <= n; i++)
    if (a[i].a == a[i - 1].a) {
      swap(a[i], a[i - 1]);
      break;
    }
  for (int i = 1; i <= n; i++) cout << a[i].num << " ";
  cout << endl;
  for (int i = n - 1; i >= 1; i--)
    if (a[i].a == a[i + 1].a) {
      swap(a[i], a[i + 1]);
      break;
    }
  for (int i = 1; i <= n; i++) cout << a[i].num << " ";
  cout << endl;
  return 0;
}
