#include <bits/stdc++.h>
using namespace std;
void showPlan(vector<pair<int, int>> &diff) {
  for (int i = 0; i < diff.size(); i++) {
    cout << diff[i].second << " ";
  }
  cout << endl;
}
int main() {
  int x, n;
  vector<pair<int, int>> diff, cnt;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    diff.push_back(make_pair(x, i));
  }
  sort(diff.begin(), diff.end());
  for (int j = 1; j < diff.size(); j++) {
    if (diff[j - 1].first == diff[j].first) cnt.push_back(make_pair(j - 1, j));
  }
  if (cnt.size() > 1) {
    cout << "YES\n";
    showPlan(diff);
    swap(diff[cnt[0].first], diff[cnt[0].second]);
    showPlan(diff);
    swap(diff[cnt[1].first], diff[cnt[1].second]);
    showPlan(diff);
  } else
    cout << "NO";
  return 0;
}
