#include <bits/stdc++.h>
using namespace std;
vector<int> arr[2005];
int ar[2005];
int main() {
  int n, k, a, c = 0;
  cin >> n;
  bool flag = 0;
  bool b = 0;
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
    arr[ar[i]].push_back(i);
  }
  for (int i = 1; i <= 2000; i++) {
    if (arr[i].size() > 2) {
      flag = 1;
      break;
    }
    if (arr[i].size() == 2) c++;
    if (c >= 2) {
      flag = 1;
      break;
    }
  }
  if (!flag) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 1; i <= 2000; i++) {
    for (int j = 0; j < arr[i].size(); j++) {
      cout << arr[i][j] << ' ';
    }
  }
  cout << endl;
  for (int i = 1; i <= 2000; i++) {
    for (int j = 0; j < arr[i].size(); j++) {
      if (arr[i].size() >= 3 && !j) {
        cout << arr[i][j + 2] << ' ' << arr[i][j + 1] << ' ' << arr[i][j]
             << ' ';
        j += 2;
      } else if (arr[i].size() >= 2 && !j && b) {
        cout << arr[i][j + 1] << ' ' << arr[i][j] << ' ';
        j += 1;
        b = !b;
      } else if (arr[i].size() >= 2 && !j && !b) {
        cout << arr[i][j] << ' ';
        b = !b;
      } else
        cout << arr[i][j] << ' ';
    }
  }
  cout << endl;
  for (int i = 1; i <= 2000; i++) {
    for (int j = 0; j < arr[i].size(); j++) {
      if (arr[i].size() >= 3 && !j) {
        cout << arr[i][j + 1] << ' ' << arr[i][j + 2] << ' ' << arr[i][j]
             << ' ';
        j += 2;
      } else if (arr[i].size() >= 2 && !j) {
        cout << arr[i][j + 1] << ' ' << arr[i][j] << ' ';
        j += 1;
      } else
        cout << arr[i][j] << ' ';
    }
  }
  return 0;
}
