#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> v[3000];
vector<int> sol[3];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int h;
    cin >> h;
    v[h].push_back(i);
  }
  int num2 = 0, num3 = 0;
  for (int i = 1; i <= 2000; i++) {
    vector<int> &w = v[i];
    if (int(w.size()) > 0) {
      if (int(w.size()) == 1) {
        for (int j = 0; j < 3; j++) sol[j].push_back(w[0]);
      } else if (int(w.size()) == 2) {
        if (num2 == 0) {
          sol[0].push_back(w[0]);
          sol[0].push_back(w[1]);
          sol[1].push_back(w[0]);
          sol[1].push_back(w[1]);
          sol[2].push_back(w[1]);
          sol[2].push_back(w[0]);
        } else {
          sol[0].push_back(w[0]);
          sol[0].push_back(w[1]);
          sol[1].push_back(w[1]);
          sol[1].push_back(w[0]);
          sol[2].push_back(w[1]);
          sol[2].push_back(w[0]);
        }
        num2++;
      } else {
        num3++;
        for (int j = 0; j < 3; j++)
          for (int k = 0; k < int(w.size()); k++)
            sol[j].push_back(w[(j + k) % int(w.size())]);
      }
    }
  }
  if (num3 or num2 >= 2) {
    cout << "YES" << endl;
    for (int i = 0; i < 3; i++) {
      vector<int> &w = sol[i];
      for (int j = 0; j < int(w.size()); j++) {
        if (j) cout << " ";
        cout << w[j];
      }
      cout << endl;
    }
  } else {
    cout << "NO" << endl;
  }
}
