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