#include <bits/stdc++.h>
using namespace std;
vector<int> data[20011];
int n, x;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    data[x].push_back(i);
  }
  int vt = 0;
  for (int i = 1; i <= 2000; i++)
    if (data[i].size() >= 3) {
      vt = i;
    }
  if (vt) {
    puts("YES");
    for (int i = 1; i <= 2000; i++)
      for (int j = 0; j < data[i].size(); j++) cout << data[i][j] << " ";
    cout << endl;
    swap(data[vt][0], data[vt][1]);
    for (int i = 1; i <= 2000; i++)
      for (int j = 0; j < data[i].size(); j++) cout << data[i][j] << " ";
    cout << endl;
    swap(data[vt][0], data[vt][2]);
    for (int i = 1; i <= 2000; i++)
      for (int j = 0; j < data[i].size(); j++) cout << data[i][j] << " ";
    cout << endl;
    return 0;
  }
  int a, b;
  a = 0;
  b = 0;
  for (int i = 1; i <= 2000; i++)
    if (data[i].size() == 2) {
      if (a == 0)
        a = i;
      else
        b = i;
    }
  if (b) {
    puts("YES");
    for (int i = 1; i <= 2000; i++)
      for (int j = 0; j < data[i].size(); j++) cout << data[i][j] << " ";
    cout << endl;
    swap(data[a][0], data[a][1]);
    for (int i = 1; i <= 2000; i++)
      for (int j = 0; j < data[i].size(); j++) cout << data[i][j] << " ";
    cout << endl;
    swap(data[b][0], data[b][1]);
    for (int i = 1; i <= 2000; i++)
      for (int j = 0; j < data[i].size(); j++) cout << data[i][j] << " ";
    cout << endl;
    return 0;
  }
  puts("NO");
  return 0;
}
