#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline int popcount(T t) {
  if (std::numeric_limits<T>::digits <=
      std::numeric_limits<unsigned int>::digits) {
    return __builtin_popcount(t);
  } else {
    return __builtin_popcountll(t);
  }
}
const long double EPS = 1e-8;
const long double PI = acosl(0.0) * 2;
void solve() {
  int n;
  cin >> n;
  vector<pair<int, int>> h(n);
  for (int i = 0; i < int(n); ++i) cin >> h[i].first, h[i].second = i;
  sort((h).begin(), (h).end());
  int l = 0;
  vector<vector<pair<int, int>>> ans;
  bool first = true;
  while (l < n && ans.size() < 3) {
    int r = l + 1;
    while (r < n && h[r].first == h[l].first) ++r;
    if (r - l > 1) {
      bool found = false;
      do {
        if (first || found) {
          ans.push_back(h);
        }
        found = true;
        first = false;
      } while (ans.size() < 3 &&
               next_permutation(h.begin() + l, h.begin() + r));
    }
    l = r;
  }
  if (ans.size() < 3) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    for (int i = 0; i < int(3); ++i) {
      for (int j = 0; j < int(n); ++j) {
        if (j) cout << " ";
        cout << ans[i][j].second + 1;
      }
      cout << endl;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  solve();
  return 0;
}
