#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 9;
long long int b[200009];
struct abc {
  long long int val, ind;
};
bool compare(abc a1, abc a2) { return (a1.val < a2.val); }
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, j, x, y, flag = 0;
  cin >> n;
  abc a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i].val;
    a[i].ind = i + 1;
    b[a[i].val]++;
    if (b[a[i].val] == 2 && flag == 0)
      flag = 1, x = a[i].val;
    else if (b[a[i].val] > 2 && flag == 1)
      flag = 2, y = a[i].val;
    else if (b[a[i].val] == 2 && y != a[i].val && flag == 1)
      flag = 2, y = a[i].val;
  }
  if (flag != 2)
    cout << "NO\n";
  else {
    cout << "YES\n";
    sort(a, a + n, compare);
    flag = 0;
    for (long long int i = 0; i < n; i++) {
      if (a[i].val == x && flag == 0) j = i, a[j].val = -1, flag = 1;
      cout << a[i].ind << ' ';
    }
    cout << '\n';
    swap(a[j].ind, a[j + 1].ind);
    if (x == y) {
      flag = 0;
      for (long long int i = 0; i < n; i++) {
        if (a[i].val == x && flag == 0) j = i, flag = 1;
        cout << a[i].ind << ' ';
      }
      cout << '\n';
    } else {
      flag = 0;
      for (long long int i = 0; i < n; i++) {
        if (a[i].val == y && flag == 0) j = i, flag = 1;
        cout << a[i].ind << ' ';
      }
      cout << '\n';
    }
    swap(a[j].ind, a[j + 1].ind);
    for (long long int i = 0; i < n; i++) {
      if (a[i].val == x && flag == 0) j = i, flag = 1;
      cout << a[i].ind << ' ';
    }
    cout << '\n';
  }
}
