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