#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt(0);
  cin >> n;
  pair<int, int> arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first;
    arr[i].second = i + 1;
  }
  sort(arr, arr + n);
  for (int i = 0; i < n; i++) {
    if (arr[i].first == arr[i + 1].first) cnt++;
  }
  if (cnt >= 2) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) cout << arr[i].second << " ";
    cout << "\n";
    for (int i = 0; i < n; i++) {
      if (arr[i].first == arr[i + 1].first) {
        swap(arr[i].second, arr[i + 1].second);
        break;
      }
    }
    for (int i = 0; i < n; i++) cout << arr[i].second << " ";
    cout << "\n";
    reverse(arr, arr + n);
    for (int i = 0; i < n; i++) {
      if (arr[i].first == arr[i + 1].first) {
        swap(arr[i].second, arr[i + 1].second);
        break;
      }
    }
    reverse(arr, arr + n);
    for (int i = 0; i < n; i++) cout << arr[i].second << " ";
  } else
    cout << "NO\n";
  return 0;
}
