#include <bits/stdc++.h>
using namespace std;
template <typename T>
constexpr string_view gtype() {
  string_view s = __PRETTY_FUNCTION__;
  return string_view(s.data() + 45, s.find(';', 45) - 45);
}
const int MAXN = 10000;
int arr[MAXN];
int best[MAXN];
int cur[MAXN];
int n;
const long long MOD = 1000000009;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<pair<int, int> > vv(n);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    vv[i] = {x, i + 1};
  }
  vector<int> sim;
  sim.push_back(-1);
  sort(((vv).begin()), ((vv).end()));
  for (int i = 0; i < int((vv).size()) - 1; i++)
    if (vv[i].first == vv[i + 1].first) sim.push_back(i);
  if (int((sim).size()) <= 2)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int j = 0; j < 3; ++j) {
      for (int i = 0; i < int((vv).size()); i++) {
        if (i == sim[j]) {
          cout << vv[i + 1].second << " " << vv[i].second << " ";
          i++;
        } else
          cout << vv[i].second << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
