#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > V;
int cnt_2 = 0, cnt_3 = 0;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int in;
    cin >> in;
    V.push_back(make_pair(in, i + 1));
  }
  sort(V.begin(), V.end());
  for (int i = 0; i < V.size(); i++) {
    if (i < V.size() - 2) {
      if (V[i].first == V[i + 1].first && V[i].first == V[i + 2].first) {
        cout << "YES\n";
        for (int j = 0; j < V.size(); j++) {
          cout << V[j].second << " ";
          if (j == i + 1) swap(V[j].second, V[j - 1].second);
        }
        cout << "\n";
        for (int j = 0; j < V.size(); j++) {
          cout << V[j].second << " ";
          if (j == i + 2) swap(V[j].second, V[j - 1].second);
        }
        cout << "\n";
        for (int j = 0; j < V.size(); j++) {
          cout << V[j].second << " ";
        }
        cout << "\n";
        return 0;
      }
    }
    if (i < V.size() - 1) {
      if (V[i].first == V[i + 1].first) cnt_2++;
      if (cnt_2 == 2) {
        cout << "YES\n";
        for (int j = 0; j < V.size(); j++) {
          cout << V[j].second << " ";
          if (V[j].first == V[j - 1].first && j > 0)
            swap(V[j].second, V[j - 1].second);
        }
        cout << "\n";
        for (int j = 0; j < V.size(); j++) {
          cout << V[j].second << " ";
          if (j == i + 1) swap(V[j].second, V[j - 1].second);
        }
        cout << "\n";
        for (int j = 0; j < V.size(); j++) {
          cout << V[j].second << " ";
        }
        cout << "\n";
        return 0;
      }
    }
  }
  cout << "NO\n";
  return 0;
}
