#include <bits/stdc++.h>
using namespace std;
int n, Sum, u[5000], S, first, k = 1, b;
vector<int> v1, v2, v3;
pair<int, int> a[5000];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &first), u[first]++;
    if (u[first] == 2) Sum++;
    if (u[first] >= 3) S++;
    a[i] = make_pair(first, i);
  }
  if (!S && Sum < 2)
    puts("NO"), exit(0);
  else
    puts("YES");
  sort(a + 1, a + n + 1);
  while (k <= n) {
    if (a[k].first == a[k + 1].first && a[k].first != a[k + 2].first) {
      if (b != 1) {
        v1.push_back(a[k].second);
        v1.push_back(a[k + 1].second);
        v2.push_back(a[k + 1].second);
        v2.push_back(a[k].second);
        v3.push_back(a[k].second);
        v3.push_back(a[k + 1].second);
        b = 1;
      } else {
        v1.push_back(a[k].second);
        v1.push_back(a[k + 1].second);
        v2.push_back(a[k + 1].second);
        v2.push_back(a[k].second);
        v3.push_back(a[k + 1].second);
        v3.push_back(a[k].second);
        b = 1;
      }
      k += 2;
    } else if (a[k].first == a[k + 1].first && a[k].first == a[k + 2].first) {
      v1.push_back(a[k].second);
      v1.push_back(a[k + 1].second);
      v1.push_back(a[k + 2].second);
      v2.push_back(a[k + 1].second);
      v2.push_back(a[k + 2].second);
      v2.push_back(a[k].second);
      v3.push_back(a[k].second);
      v3.push_back(a[k + 2].second);
      v3.push_back(a[k + 1].second);
      k += 3;
    } else {
      v1.push_back(a[k].second);
      v2.push_back(a[k].second);
      v3.push_back(a[k].second);
      k++;
    }
  }
  for (int i = 0; i < v1.size(); ++i) printf("%d ", v1[i]);
  cout << endl;
  for (int i = 0; i < v2.size(); ++i) printf("%d ", v2[i]);
  cout << endl;
  for (int i = 0; i < v3.size(); ++i) printf("%d ", v3[i]);
  return 0;
}
