#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int main() {
  int n, m;
  cin >> n;
  std::vector<std::pair<int, int> > del;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    del.push_back(make_pair(a, i + 1));
  }
  sort((del).begin(), (del).end());
  std::vector<int> r;
  for (int i = 0; i < n - 1; i++) {
    if (del[i].first == del[i + 1].first) r.push_back(i);
  }
  if (r.size() <= 1)
    cout << "NO";
  else {
    std::vector<std::vector<int> > ans(3, std::vector<int>(n));
    for (int ad = 0; ad < 3; ad++)
      for (int i = 0; i < n; i++) ans[ad][i] = del[i].second;
    swap(ans[1][r[0]], ans[1][r[0] + 1]);
    swap(ans[2][r[1]], ans[2][r[1] + 1]);
    cout << "YES" << endl;
    for (int ad = 0; ad < 3; ad++) {
      for (int i = 0; i < n; i++) {
        cout << ans[ad][i] << " ";
      }
      cout << endl;
    }
  }
}
