#include <bits/stdc++.h>
using namespace std;
template <class C>
void mini(C& a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C& a4, C b4) {
  a4 = max(a4, b4);
}
template <class T1, class T2>
ostream& operator<<(ostream& rout, pair<T1, T2> pair) {
  return rout << "(" << pair.first << ", " << pair.second << ")";
}
int main() {
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int n;
  cin >> n;
  vector<pair<int, int> > T(n);
  for (int i = 0; i < (n); ++i) {
    cin >> T[i].first;
    T[i].second = i;
  }
  sort((T).begin(), (T).end());
  vector<int> df;
  for (int i = 0; i < (n - 1); ++i) {
    if (T[i].first == T[i + 1].first) df.push_back(i);
  }
  if (((int)(df).size()) >= 2)
    cout << "YES" << endl;
  else {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 0; i < (n); ++i) cout << T[i].second + 1 << " ";
  cout << endl;
  swap(T[df[0]], T[df[0] + 1]);
  for (int i = 0; i < (n); ++i) cout << T[i].second + 1 << " ";
  cout << endl;
  swap(T[df[1]], T[df[1] + 1]);
  for (int i = 0; i < (n); ++i) cout << T[i].second + 1 << " ";
  cout << endl;
  return 0;
}
