#include <bits/stdc++.h>
using namespace std;
pair<int, int> b[4000];
int main() {
  int n, x, c = 0, d = 0;
  cin >> n;
  int a[4000];
  fill(a, a + 4000, 0);
  for (int i = 0; i < n; i++) {
    cin >> x;
    a[x]++;
    b[i].first = x;
    b[i].second = i + 1;
  }
  sort(b, b + n);
  for (int i = 0; i < 4000; i++) {
    if (a[i] > 1) {
      c += a[i];
      d++;
    }
    if (c >= 3) break;
  }
  if (c < 3) {
    cout << "NO";
    return 0;
  }
  bool ok;
  cout << "YES" << endl;
  if (d == 1) {
    for (int i = 0; i < n; i++) {
      cout << b[i].second << ' ';
    }
    cout << endl;
    ok = false;
    for (int i = 0; i < n; i++) {
      if (a[b[i].first] > 1 && ok == false) {
        ok = 1;
        cout << b[i + 1].second << ' ';
        cout << b[i].second << ' ';
        i++;
      } else {
        cout << b[i].second << ' ';
      }
    }
    cout << endl;
    ok = false;
    for (int i = 0; i < n; i++) {
      if (a[b[i].first] > 1 && ok == false) {
        ok = 1;
        cout << b[i + 2].second << ' ';
        cout << b[i].second << ' ';
        cout << b[i + 1].second << ' ';
        i += 2;
      } else {
        cout << b[i].second << ' ';
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      cout << b[i].second << ' ';
    }
    cout << endl;
    x = 0;
    for (int i = 0; i < n; i++) {
      if (a[b[i].first] > 1 && x == 0) {
        cout << b[i + 1].second << ' ';
        x++;
        cout << b[i].second << ' ';
        i++;
      } else {
        cout << b[i].second << ' ';
      }
    }
    cout << endl;
    x = 0;
    for (int i = 0; i < n; i++) {
      if (a[b[i].first] > 1 && x == 0) {
        cout << b[i + 1].second << ' ';
        x++;
        cout << b[i].second << ' ';
        i++;
      } else if (a[b[i].first] > 1 && x == 1) {
        cout << b[i + 1].second << ' ';
        x++;
        cout << b[i].second << ' ';
        i++;
      } else {
        cout << b[i].second << ' ';
      }
    }
  }
  return 0;
}
