#include <bits/stdc++.h>
using namespace std;
int arr[2001];
pair<int, int> p[2001];
int f[2001];
int main() {
  int n;
  cin >> n;
  int i;
  for (i = 0; i < n; ++i) {
    cin >> arr[i];
    p[i].first = arr[i];
    p[i].second = i;
    f[arr[i]] += 1;
  }
  sort(p, p + n);
  int flag = 0;
  int ctr3 = 0, ctr2 = 0, pos_3 = -1;
  pair<int, int> pos_2;
  for (i = 0; i < 2001; ++i) {
    if (f[i] == 2) {
      ++ctr2;
      if (ctr2 == 2) {
        pos_2.second = i;
        flag = 1;
        break;
      } else {
        pos_2.first = i;
      }
    }
    if (f[i] > 2) {
      flag = 1;
      pos_3 = i;
      break;
    }
  }
  if (flag) {
    cout << "YES";
    if (pos_3 != -1) {
      cout << "\n";
      for (i = 0; i < n; ++i) cout << p[i].second + 1 << " ";
      cout << "\n";
      bool f2 = 0;
      for (i = 0; i < n; ++i) {
        if (p[i].first != pos_3 || f2)
          cout << p[i].second + 1 << " ";
        else {
          f2 = 1;
          cout << p[i + 1].second + 1 << " " << p[i].second + 1 << " "
               << p[i + 2].second + 1 << " ";
          ++i;
          ++i;
        }
      }
      cout << "\n";
      f2 = 0;
      for (i = 0; i < n; ++i) {
        if (p[i].first != pos_3 || f2)
          cout << p[i].second + 1 << " ";
        else {
          f2 = 1;
          cout << p[i + 2].second + 1 << " " << p[i + 1].second + 1 << " "
               << p[i].second + 1 << " ";
          ++i;
          ++i;
        }
      }
    } else {
      cout << "\n";
      for (i = 0; i < n; ++i) cout << p[i].second + 1 << " ";
      cout << "\n";
      for (i = 0; i < n; ++i) {
        if (p[i].first != pos_2.first)
          cout << p[i].second + 1 << " ";
        else {
          cout << p[i + 1].second + 1 << " " << p[i].second + 1 << " ";
          ++i;
        }
      }
      cout << "\n";
      for (i = 0; i < n; ++i) {
        if (p[i].first != pos_2.second)
          cout << p[i].second + 1 << " ";
        else {
          cout << p[i + 1].second + 1 << " " << p[i].second + 1 << " ";
          ++i;
        }
      }
    }
  } else {
    cout << "NO";
  }
  return 0;
}
