#include <bits/stdc++.h>
using namespace std;
const int nmax = 2005;
int v[nmax + 1], f[nmax + 1];
struct str {
  int x, y;
};
str k[nmax + 1];
int fact(int x) {
  int ans = 1;
  for (int i = 1; i <= x; ++i) ans *= i;
  return ans;
}
bool comp(str x, str y) {
  if (x.x == y.x) return x.y < y.y;
  return x.x < y.x;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> v[i];
    ++f[v[i]];
    k[i].x = v[i], k[i].y = i;
  }
  sort(k + 1, k + n + 1, comp);
  int sol = 1;
  bool ok = 0;
  for (int i = 1; i <= nmax && ok == 0 && sol < 3; ++i) {
    if (f[i] >= 3)
      ok = 1;
    else {
      sol *= fact(f[i]);
    }
  }
  if (sol >= 3) ok = 1;
  if (ok == 0) {
    cout << "NO\n";
    return 0;
  } else {
    cout << "YES\n";
    for (int i = 1; i <= n; ++i) {
      cout << k[i].y << " ";
    }
    cout << "\n";
    int pos1 = 0, pos2 = 0;
    for (int i = 1; i <= n; ++i) {
      if (k[i].x == k[i + 1].x && pos1 == 0) {
        pos1 = i;
      } else if (k[i].x == k[i + 1].x && i > pos1)
        pos2 = i;
    }
    for (int i = 1; i <= pos1 - 1; ++i) cout << k[i].y << " ";
    cout << k[pos1 + 1].y << " " << k[pos1].y << " ";
    for (int i = pos1 + 2; i <= n; ++i) cout << k[i].y << " ";
    cout << "\n";
    for (int i = 1; i <= pos2 - 1; ++i) cout << k[i].y << " ";
    cout << k[pos2 + 1].y << " " << k[pos2].y << " ";
    for (int i = pos2 + 2; i <= n; ++i) cout << k[i].y << " ";
    cout << "\n";
  }
  return 0;
}
