#include <bits/stdc++.h>
using namespace std;
typedef struct Node {
  int x;
  int y;
} Node;
bool compare(Node a, Node b) { return a.x < b.x; }
int main() {
  int i, t, flag, sum, u, a, b;
  Node s[2005];
  while (cin >> t) {
    for (i = 0, sum = 0; i < t; i++) {
      cin >> s[i].x;
      s[i].y = i + 1;
    }
    sort(s, s + t, compare);
    for (i = 0, u = -1; i < t - 1; i++) {
      if (s[i].x == s[i + 1].x) {
        if (u == -1)
          a = i;
        else
          b = i;
        sum++;
        u = s[i].x;
      }
      if (sum == 2) break;
    }
    if (sum == 2) {
      cout << "YES" << endl;
      for (i = 0; i < t; i++) {
        if (i != 0) cout << " ";
        cout << s[i].y;
      }
      cout << endl;
      u = s[a].y;
      s[a].y = s[a + 1].y;
      s[a + 1].y = u;
      for (i = 0; i < t; i++) {
        if (i != 0) cout << " ";
        cout << s[i].y;
      }
      cout << endl;
      u = s[b].y;
      s[b].y = s[b + 1].y;
      s[b + 1].y = u;
      for (i = 0; i < t; i++) {
        if (i != 0) cout << " ";
        cout << s[i].y;
      }
      cout << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
