#include <bits/stdc++.h>
using namespace std;
int dos, tres, aux, n;
vector<int> arr[2010];
bool gud;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> aux;
    arr[aux].push_back(i + 1);
    if (arr[aux].size() == 2) {
      dos++;
    } else if (arr[aux].size() >= 3)
      tres++;
  }
  if (tres) {
    cout << "YES\n";
    for (int i = 1; i <= 2000; i++)
      for (int j = 0; j < arr[i].size(); j++) cout << arr[i][j] << " ";
    cout << "\n";
    for (int i = 1; i <= 2000; i++)
      for (int j = arr[i].size() - 1; j > -1; j--) cout << arr[i][j] << " ";
    cout << "\n";
    for (int i = 1; i <= 2000; i++)
      if (arr[i].size() <= 2) {
        for (int j = 0; j < arr[i].size(); j++) cout << arr[i][j] << " ";
      } else {
        cout << arr[i][0] << " " << arr[i][2] << " " << arr[i][1] << " ";
        for (int j = 3; j < arr[i].size(); j++) cout << arr[i][j] << " ";
      }
  } else if (dos >= 2) {
    cout << "YES\n";
    for (int i = 1; i <= 2000; i++)
      for (int j = 0; j < arr[i].size(); j++) cout << arr[i][j] << " ";
    cout << "\n";
    for (int i = 1; i <= 2000; i++)
      for (int j = arr[i].size() - 1; j > -1; j--) cout << arr[i][j] << " ";
    cout << "\n";
    gud = true;
    for (int i = 1; i <= 2000; i++)
      if (arr[i].size() == 2 && gud) {
        for (int j = arr[i].size() - 1; j > -1; j--) cout << arr[i][j] << " ";
        gud = false;
      } else
        for (int j = 0; j < arr[i].size(); j++) cout << arr[i][j] << " ";
  } else
    cout << "NO";
}
