#include <bits/stdc++.h>
using namespace std;
int a[2222];
vector<int> g[2222];
void print(int order) {
  if (order == 1) {
    for (int i = 1; i <= 2000; i++)
      for (int j = 0; j < g[i].size(); j++) cout << g[i][j] << " ";
    cout << endl;
  } else if (order == 2) {
    bool was = false;
    for (int i = 1; i <= 2000; i++)
      if (int((g[i]).size()) >= 2 && !was) {
        cout << g[i][1] << " " << g[i][0] << " ";
        for (int k = 2; k < int((g[i]).size()); k++) cout << g[i][k] << " ";
        was = 1;
      } else {
        for (int j = 0; j < g[i].size(); j++) cout << g[i][j] << " ";
      }
    cout << endl;
  } else {
    for (int i = 1; i <= 2000; i++)
      if (int((g[i]).size()) >= 3) {
        cout << g[i][2] << " " << g[i][0] << " " << g[i][1] << " ";
        for (int k = 3; k < int((g[i]).size()); k++) cout << g[i][k] << " ";
      } else if (int((g[i]).size()) == 2) {
        cout << g[i][1] << " " << g[i][0] << " ";
      } else if (int((g[i]).size()) == 1) {
        cout << g[i][0] << " ";
      }
  }
}
void oku() {
  int n;
  scanf("%d", &n);
  set<int> s;
  int c1 = -1;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    g[a[i]].push_back(i + 1);
    s.insert(a[i]);
  }
  if (s.size() >= n - 1) {
    puts("NO");
    return;
  }
  puts("YES");
  print(1);
  print(2);
  print(3);
}
int main() {
  oku();
  return 0;
}
