#include <bits/stdc++.h>
using namespace std;
struct par {
  int count;
  vector<int> pos;
};
int main() {
  int n;
  par a[2001];
  for (int i = 0; i < 2001; i++) a[i].count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    a[t].count++;
    a[t].pos.push_back(i + 1);
  }
  bool tree = false;
  int trindex = 0;
  for (int i = 0; i < 2001; i++)
    if (a[i].count >= 3) {
      tree = true;
      trindex = i;
    }
  if (tree) {
    cout << "YES\n";
    for (int i = 0; i < 2001; i++)
      if (a[i].count != 0) {
        int N = a[i].pos.size();
        for (int j = 0; j < N; j++) cout << a[i].pos[j] << " ";
      }
    cout << "\n";
    for (int i = 0; i < 2001; i++)
      if (a[i].count != 0) {
        int N = a[i].pos.size();
        if (trindex == i) {
          cout << a[i].pos[1] << " ";
          for (int j = 0; j < N; j++)
            if (j != 1) cout << a[i].pos[j] << " ";
        } else {
          for (int j = 0; j < N; j++) cout << a[i].pos[j] << " ";
        }
      }
    cout << "\n";
    for (int i = 0; i < 2001; i++)
      if (a[i].count != 0) {
        int N = a[i].pos.size();
        if (trindex == i) {
          cout << a[i].pos[2] << " ";
          for (int j = 0; j < N; j++)
            if (j != 2) cout << a[i].pos[j] << " ";
        } else {
          for (int j = 0; j < N; j++) cout << a[i].pos[j] << " ";
        }
      }
    return 0;
  }
  bool two1 = false;
  bool two2 = false;
  int trindexA = 0;
  int trindexB = 0;
  for (int i = 0; i < 2001; i++) {
    if (a[i].count == 2 && !two1) {
      two1 = true;
      trindexA = i;
      continue;
    }
    if (a[i].count == 2 && two1) {
      two2 = true;
      trindexB = i;
      break;
    }
  }
  if (two1 && two2) {
    cout << "YES\n";
    for (int i = 0; i < 2001; i++)
      if (a[i].count != 0) {
        int N = a[i].pos.size();
        for (int j = 0; j < N; j++) cout << a[i].pos[j] << " ";
      }
    cout << "\n";
    for (int i = 0; i < 2001; i++)
      if (a[i].count != 0) {
        int N = a[i].pos.size();
        if (trindexA == i) {
          cout << a[i].pos[1] << " ";
          for (int j = 0; j < N; j++)
            if (j != 1) cout << a[i].pos[j] << " ";
        } else {
          for (int j = 0; j < N; j++) cout << a[i].pos[j] << " ";
        }
      }
    cout << "\n";
    for (int i = 0; i < 2001; i++)
      if (a[i].count != 0) {
        int N = a[i].pos.size();
        if (trindexB == i) {
          cout << a[i].pos[1] << " ";
          for (int j = 0; j < N; j++)
            if (j != 1) cout << a[i].pos[j] << " ";
        } else {
          for (int j = 0; j < N; j++) cout << a[i].pos[j] << " ";
        }
      }
    return 0;
  }
  cout << "NO";
  return 0;
}
