#include <bits/stdc++.h>
using namespace std;
template <typename T>
string tostr(const T& t) {
  ostringstream os;
  os << t;
  return os.str();
}
set<pair<int, int> > swapped;
bool fix(vector<pair<int, int> >& ans) {
  bool ok = false;
  for (int i = (int)(0); i <= (int)((int)ans.size() - 1 - 1); ++i) {
    if (swapped.count(pair<int, int>(i, i + 1))) continue;
    if (ans[i].first == ans[i + 1].first) {
      swap(ans[i], ans[i + 1]);
      swapped.insert(pair<int, int>(i, i + 1));
      return true;
    }
  }
  return false;
}
void dump(vector<pair<int, int> >& cur) {
  for (int i = (int)(0); i <= (int)((int)cur.size() - 1); ++i) {
    cout << (cur[i].second + 1) << " ";
  }
  cout << endl;
}
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > tasks;
  for (int i = (int)(0); i <= (int)(n - 1); ++i) {
    int d;
    cin >> d;
    tasks.push_back(pair<int, int>(d, i));
  }
  sort((tasks).begin(), (tasks).end());
  vector<pair<int, int> > ans1 = tasks;
  vector<pair<int, int> > ans2 = tasks;
  vector<pair<int, int> > ans3 = tasks;
  if (fix(ans2) & fix(ans3)) {
    cout << "YES" << endl;
    dump(ans1);
    dump(ans2);
    dump(ans3);
  } else {
    cout << "NO";
  }
  return 0;
}
