#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, v;
  vector<int> tasks, position;
  map<int, vector<int> > M;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> v;
    tasks.push_back(v);
    if (M.find(v) == M.end()) {
      position.clear();
      position.push_back(i + 1);
      M[v] = position;
    } else {
      M[v].push_back(i + 1);
    }
  }
  sort(tasks.begin(), tasks.end());
  map<int, vector<int> >::iterator it;
  int A11 = -1, A12 = -1, A2 = -1;
  for (it = M.begin(); it != M.end(); it++) {
    v = it->first;
    position = it->second;
    if (position.size() > 2) {
      A2 = v;
      break;
    }
    if (position.size() == 2) {
      if (A11 == -1)
        A11 = v;
      else
        A12 = v;
    }
  }
  if ((A11 == -1 | A12 == -1) & A2 == -1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    if (A2 != -1) {
      for (it = M.begin(); it != M.end(); it++) {
        position = it->second;
        for (int i = 0; i < position.size(); i++) {
          cout << position[i] << " ";
        }
      }
      cout << endl;
      position = M[A2];
      swap(position[0], position[1]);
      M[A2] = position;
      for (it = M.begin(); it != M.end(); it++) {
        position = it->second;
        for (int i = 0; i < position.size(); i++) {
          cout << position[i] << " ";
        }
      }
      cout << endl;
      position = M[A2];
      swap(position[2], position[1]);
      M[A2] = position;
      for (it = M.begin(); it != M.end(); it++) {
        position = it->second;
        for (int i = 0; i < position.size(); i++) {
          cout << position[i] << " ";
        }
      }
      cout << endl;
    } else {
      for (it = M.begin(); it != M.end(); it++) {
        position = it->second;
        for (int i = 0; i < position.size(); i++) {
          cout << position[i] << " ";
        }
      }
      cout << endl;
      position = M[A11];
      swap(position[0], position[1]);
      M[A11] = position;
      for (it = M.begin(); it != M.end(); it++) {
        position = it->second;
        for (int i = 0; i < position.size(); i++) {
          cout << position[i] << " ";
        }
      }
      cout << endl;
      position = M[A12];
      swap(position[0], position[1]);
      M[A12] = position;
      for (it = M.begin(); it != M.end(); it++) {
        position = it->second;
        for (int i = 0; i < position.size(); i++) {
          cout << position[i] << " ";
        }
      }
      cout << endl;
    }
  }
  return 0;
}
