#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000 + 7;
const double esp = 1e-13;
const double pi = 3.141592653589;
long long power(long long a, long long n) {
  long long tmp, c;
  tmp = c = a;
  n--;
  while (n) {
    if (n % 2) tmp = tmp * c;
    c = c * c;
    n /= 2;
  }
  return tmp;
}
int bit(long long x, int y) { return (x >> (y - 1) & 1); }
struct node {
  int gt, vt;
};
int f[2000 + 10], n, ans;
node a[2000 + 10];
bool cmp(node a, node b) {
  return (a.gt < b.gt || (a.gt == b.gt && a.vt < b.vt));
}
int main() {
  cin >> n;
  for (int i = (1), _b = (n); i <= _b; i++) {
    cin >> a[i].gt;
    a[i].vt = i;
    f[a[i].gt]++;
  }
  sort(a + 1, a + n + 1, cmp);
  ans = 1;
  for (int i = (1), _b = (2000); i <= _b; i++)
    if (f[i]) {
      ans = ans * f[i];
      if (ans >= 3) {
        cout << "YES\n";
        for (int i = (1), _b = (n); i <= _b; i++) cout << a[i].vt << " ";
        cout << "\n";
        for (int i = (1), _b = (n); i <= _b; i++)
          if (a[i].gt == a[i + 1].gt) {
            cout << a[i + 1].vt << " " << a[i].vt << " ";
            for (int j = (i + 2), _b = (n); j <= _b; j++)
              cout << a[j].vt << " ";
            break;
          } else
            cout << a[i].vt << " ";
        cout << "\n";
        for (int i = (n), _b = (1); i >= _b; i--)
          if (a[i].gt == a[i + 1].gt) {
            for (int j = (1), _b = (i - 1); j <= _b; j++)
              cout << a[j].vt << " ";
            cout << a[i + 1].vt << " " << a[i].vt << " ";
            for (int j = (i + 2), _b = (n); j <= _b; j++)
              cout << a[j].vt << " ";
            return 0;
          }
      }
    }
  cout << "NO";
}
