#include <bits/stdc++.h>
using namespace std;
vector<int> b[2222];
const int Peak = 2001;
vector<int> ans[3];
int a[2222];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[a[i]].push_back(i + 1);
  }
  int method = 1;
  for (int i = 1; i < Peak; i++) {
    if (b[i].size() >= 1) method *= b[i].size();
    if (method >= 3) break;
  }
  if (method < 3)
    cout << "NO" << endl;
  else {
    bool _1 = false, _2 = false;
    cout << "YES" << endl;
    for (int i = 1; i < Peak; i++) {
      if (b[i].size() != 0) {
        for (int k = 0; k < 3; k++)
          for (int j = 0; j < b[i].size(); j++) ans[k].push_back(b[i][j]);
        if (!_2 and b[i].size() == 2) {
          int len = ans[0].size();
          if (!_1)
            swap(ans[1][len - 2], ans[1][len - 1]), _1 = true;
          else if (!_2)
            swap(ans[2][len - 2], ans[2][len - 1]), _2 = true;
        }
        if (!_2 and b[i].size() >= 3) {
          int len = ans[0].size();
          swap(ans[1][len - 1], ans[1][len - 2]);
          swap(ans[2][len - 3], ans[2][len - 1]);
          _1 = true, _2 = true;
        }
      }
    }
    for (int i = 0; i < 3; i++, cout << endl)
      for (int j = 0; j < ans[i].size(); j++) cout << ans[i][j] << " ";
  }
}
