#include <bits/stdc++.h>
using namespace std;
pair<int, int> arr[2000 + 5];
int freq[2000 + 5];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i].first);
    freq[arr[i].first]++;
    arr[i].second = i;
  }
  sort(arr, arr + n);
  int x = 1;
  for (int i = 0; i < 2000 + 5; i++) {
    if (freq[i] > 0) x *= freq[i];
    if (x >= 3) break;
  }
  if (x < 3) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    int x = 3;
    while (x--) {
      for (int i = 0; i < n; i++) cout << arr[i].second + 1 << ' ';
      cout << endl;
      for (int i = 0; i < n; i++) {
        if (freq[arr[i].first] >= 2) {
          swap(arr[i], arr[i + 1]);
          freq[arr[i].first]--;
          arr[i].first = 0;
          break;
        }
      }
    }
  }
}
