#include <bits/stdc++.h>
using namespace std;
int n, a[2222];
int main() {
  vector<int> v[2222];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    v[a[i]].push_back(i + 1);
  }
  long long s = 1;
  for (int i = 0; i <= 2001; i++) {
    if (v[i].size()) s *= v[i].size();
    if (s >= 3) break;
  }
  if (s < 3)
    cout << "NO";
  else {
    cout << "YES\n";
    for (int i = 0; i <= 2001; i++)
      for (int j = 0; j < v[i].size(); j++) cout << v[i][j] << " ";
    cout << endl;
    int p = -1, t = -1, p1 = 0, p2 = 0;
    for (int i = 0; i <= 2001; i++) {
      p1 = 0;
      if (v[i].size() >= 2 && p == -1) {
        cout << v[i][1] << " " << v[i][0] << " ";
        p = i;
        p1 = 2;
      }
      for (int j = p1; j < v[i].size(); j++) cout << v[i][j] << " ";
    }
    cout << endl;
    for (int i = 0; i <= 2001; i++) {
      p1 = 0;
      if (v[i].size() == 2 && p != i && t == -1) {
        cout << v[i][1] << " " << v[i][0] << " ";
        t = i;
        p1 = 2;
      } else if (v[i].size() > 2 && t == -1) {
        cout << v[i][2] << " " << v[i][0] << " " << v[i][1] << " ";
        t = i;
        p1 = 3;
      }
      for (int j = p1; j < v[i].size(); j++) cout << v[i][j] << " ";
    }
  }
  return 0;
}
