#include <bits/stdc++.h>
const int maxn = 2000 + 9 - 4;
using namespace std;
vector<int> c[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  int sajjad;
  int n;
  cin >> n;
  int t = 0, tt = 0, w = 0, q = 0;
  for (int i = 1; i <= n; i++) {
    cin >> sajjad;
    c[sajjad].push_back(i);
    if (c[sajjad].size() >= 2) {
      t++;
      if (w == 0)
        w = sajjad;
      else if (q == 0)
        q = sajjad;
    }
    if (c[sajjad].size() >= 3) tt = sajjad;
  }
  if (t < 2) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  int g = 0;
  if (tt != 0) {
    while (g != 3) {
      for (int i = 1; i < maxn; i++)
        if (c[i].size()) {
          if (i == tt) {
            if (g == 0)
              cout << c[i][0] << " " << c[i][1] << " " << c[i][2] << " ";
            if (g == 1)
              cout << c[i][1] << " " << c[i][0] << " " << c[i][2] << " ";
            if (g == 2)
              cout << c[i][1] << " " << c[i][2] << " " << c[i][0] << " ";
            g++;
            for (int j = 3; j < c[i].size(); j++) cout << c[i][j] << " ";
          } else
            for (int j = 0; j < c[i].size(); j++) cout << c[i][j] << " ";
        }
      cout << endl;
    }
    return 0;
  }
  g = 0;
  while (g != 3) {
    g++;
    for (int i = 1; i < maxn; i++)
      if (c[i].size()) {
        if (i == w) {
          if (g == 1 || g == 3)
            cout << c[i][0] << " " << c[i][1] << " ";
          else
            cout << c[i][1] << " " << c[i][0] << " ";
        }
        if (i == q) {
          if (g == 3)
            cout << c[i][1] << " " << c[i][0] << " ";
          else
            cout << c[i][0] << " " << c[i][1] << " ";
        }
        if (i != w && i != q)
          for (int j = 0; j < c[i].size(); j++) cout << c[i][j] << " ";
      }
    cout << endl;
  }
}
