#include <bits/stdc++.h>
using namespace std;
void fastInOut() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
}
int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
int dy[] = {1, -1, 0, 0, -1, 1, -1, 1};
const int INF = 0x3f3f3f3f;
long long inf = 0x3f3f3f3f3f3f3f3f;
string IntToString(int a) {
  ostringstream temp;
  temp << a;
  return temp.str();
}
int main() {
  map<int, vector<int> > mapa;
  int n;
  cin >> n;
  int x;
  vector<int> all;
  set<int> set1;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    if (mapa[x].size() == 0)
      mapa[x].push_back(i);
    else if (mapa[x].size() == 1) {
      all.push_back(mapa[x][0]);
      all.push_back(i);
      mapa[x].push_back(i);
      cnt++;
    } else if (mapa[x].size() >= 2) {
      all.push_back(i);
      mapa[x].push_back(i);
    }
    set1.insert(x);
  }
  if (all.size() <= 2) {
    cout << "NO";
    return 0;
  }
  set<int>::iterator it = set1.begin();
  int last = -1;
  bool used = 0;
  cout << "YES" << endl;
  for (int i = 0; i < 3; i++) {
    used = 0;
    for (it = set1.begin(); it != set1.end(); it++) {
      x = *it;
      if (mapa[x].size() == 1)
        cout << mapa[x][0] << " ";
      else if (mapa[x].size() > 1) {
        int cnto = mapa[x].size();
        for (int j = 0; j < cnto; j++) cout << mapa[x][j] << " ";
        if (!used && last != x) {
          used = 1;
          last = x;
          next_permutation(mapa[x].begin(), mapa[x].end());
        }
        if (cnt == 1) {
          used = 0;
          last = -1;
        }
      }
    }
    cout << endl;
  }
}
