#include <bits/stdc++.h>
using namespace std;
int a[111111] = {0};
int main() {
  int n, c = 0;
  int f = 0;
  cin >> n;
  vector<pair<int, int> > v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].first;
    v[i].second = i + 1;
    a[v[i].first]++;
    if (a[v[i].first] >= 2) c++;
    if (c >= 2) f = 1;
  }
  if (!f) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  sort(v.begin(), v.end());
  int cow = -1;
  for (int j = 0; j < 3; j++) {
    f = 0;
    for (int i = 0; i < n; i++) {
      cout << v[i].second << " ";
      if (i && i != cow && !f && v[i].first == v[i - 1].first) {
        swap(v[i].second, v[i - 1].second);
        f = 1;
        cow = i;
      }
    }
    cout << endl;
  }
}
