#include <bits/stdc++.h>
using namespace std;
int A[2000 + 10];
struct Node {
  int num;
  int k;
} N[2000 + 10];
bool cmp(Node a, Node b) { return a.num < b.num; }
int main() {
  int n;
  cin >> n;
  set<int> s;
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
    N[i].num = A[i];
    N[i].k = i;
    s.insert(A[i]);
  }
  if (n <= 2) {
    cout << "NO" << endl;
    return 0;
  }
  if (n == 3 && s.size() != 1) {
    cout << "NO" << endl;
    return 0;
  }
  if (s.size() <= (n - 2)) {
    printf("YES\n");
  } else {
    printf("NO\n");
    return 0;
  }
  sort(N + 1, N + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    cout << N[i].k << " ";
  }
  cout << endl;
  bool flag = true;
  for (int i = 1; i <= n; i++) {
    if (flag) {
      if (i == n) {
        cout << N[i].k << " ";
      } else if (N[i].num == N[i + 1].num) {
        cout << N[i + 1].k << " ";
        cout << N[i].k << " ";
        i++;
        flag = false;
      } else {
        cout << N[i].k << " ";
      }
    } else {
      cout << N[i].k << " ";
    }
  }
  cout << endl;
  flag = false;
  for (int i = 1; i <= n; i++) {
    if (flag) {
      if (i == n) {
        cout << N[i].k << " ";
      } else if (N[i].num == N[i + 1].num) {
        cout << N[i + 1].k << " ";
        cout << N[i].k << " ";
        i++;
      } else {
        cout << N[i].k << " ";
      }
    } else {
      if (N[i].num == N[i + 1].num) {
        flag = true;
      }
      cout << N[i].k << " ";
    }
  }
  cout << endl;
}
