#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > my_vec;
int main() {
  int i, j, ans = 0, pos[5] = {-1}, count = 0, n, tot = 0, temp, k = 0,
            time = 0;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> temp, my_vec.push_back(make_pair(temp, i));
  sort(my_vec.begin(), my_vec.end());
  for (i = 0; i < n && tot < 3; i++) {
    temp = my_vec[i].first, count = 0;
    for (j = i + 1; j < n; j++) {
      if (my_vec[j].first == temp) count++;
    }
    if (count > 0) tot += (count + 1), pos[k] = i, time++, k++;
  }
  if (tot < 3)
    cout << "NO";
  else {
    cout << "YES\n";
    if (time == 1) {
      for (i = 1; i <= 3; i++) {
        for (j = 0; j < n; j++) {
          if (j == pos[0] && i == 2)
            cout << my_vec[pos[0] + 1].second << " " << my_vec[pos[0]].second
                 << " ",
                j++;
          else if (j == pos[0] && i == 3) {
            temp = my_vec[pos[0]].second;
            cout << my_vec[pos[0] + 1].second << " "
                 << my_vec[pos[0] + 2].second << " " << temp << " ";
            j += 2;
          } else
            cout << my_vec[j].second << " ";
        }
        cout << endl;
      }
    } else {
      for (i = 1; i <= 3; i++) {
        for (j = 0; j < n; j++) {
          if (j == pos[0] && i == 2) {
            cout << my_vec[pos[0] + 1].second << " " << my_vec[pos[0]].second
                 << " ";
            j++;
          } else if (j == pos[1] && i == 3) {
            cout << my_vec[pos[1] + 1].second << " " << my_vec[pos[1]].second
                 << " ";
            j++;
          } else
            cout << my_vec[j].second << " ";
        }
        cout << endl;
      }
    }
  }
  return 0;
}
