#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
int n, A[2005], ans[5][2005], cnt;
vector<int> v[2005];
void solve(int x) {
  if (x > 2000) {
    cnt++;
    int k = 0;
    for (int i = 1; i <= 2000; i++) {
      for (int j = 0; j < v[i].size(); j++) {
        ans[cnt][++k] = v[i][j];
      }
    }
    if (cnt == 3) {
      cout << "YES" << endl;
      for (int i = 1; i <= 3; i++) {
        for (int j = 1; j <= n; j++) cout << ans[i][j] << " ";
        cout << endl;
      }
      exit(0);
    }
    return;
  }
  sort(v[x].begin(), v[x].end());
  do {
    solve(x + 1);
  } while (next_permutation(v[x].begin(), v[x].end()));
}
int main() {
  int x, cnt = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    v[x].push_back(i);
  }
  solve(1);
  cout << "NO" << endl;
  return 0;
}
