#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &operator<<(ostream &s, const vector<T> &a) {
  for (int i = 0; i < a.size(); ++i) {
    s << a[i] << ' ';
  }
  return s;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<pair<int, int> > a(n);
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    a[i] = make_pair(t, i);
  }
  sort(a.begin(), a.end());
  int cnt = 0;
  vector<int> s;
  for (int i = 1; i < n; ++i) {
    if (a[i].first == a[i - 1].first) {
      ++cnt;
      s.push_back(i);
    }
  }
  if (cnt < 2) {
    cout << "NO\n";
    return 0;
  } else
    cout << "YES\n";
  vector<int> a1(n);
  for (int i = 0; i < n; ++i) {
    a1[i] = a[i].second + 1;
  }
  vector<int> a2(a1), a3(a1);
  swap(a2[s[0]], a2[s[0] - 1]);
  swap(a3[s[1]], a3[s[1] - 1]);
  cout << a1 << endl;
  cout << a2 << endl;
  cout << a3 << endl;
  return 0;
}
