#include <bits/stdc++.h>
using namespace std;
int n, x;
vector<pair<int, int> > arr;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    arr.push_back(make_pair(x, i + 1));
  }
  int ind[2];
  sort(arr.begin(), arr.end());
  int cnt = 0;
  for (int i = 1; i < n; i++) {
    if (arr[i].first == arr[i - 1].first) {
      ind[cnt] = i - 1;
      cnt++;
      if (cnt == 2) break;
    }
  }
  if (cnt < 2)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    int index = 0;
    for (int i = 0; i < 3; i++) {
      if (i == 2) index++;
      for (int j = 0; j < n; j++) {
        if (ind[index] == j && i == 0) {
          cout << arr[j].second << " " << arr[j + 1].second << " ";
          j++;
        } else if (ind[index] == j && i == 1) {
          cout << arr[j + 1].second << " " << arr[j].second << " ";
          j++;
        } else if (ind[index] == j) {
          cout << arr[j + 1].second << " " << arr[j].second << " ";
          j++;
        } else
          cout << arr[j].second << " ";
      }
      cout << endl;
    }
  }
}
