#include <bits/stdc++.h>
using namespace std;
static int n, c[2005];
static pair<int, int> a[2005];
int main() {
  int t = 1;
  while (t--) {
    cin >> n;
    fill(c, c + 2002, 0);
    for (int i = 1; i <= n; i++) {
      cin >> a[i].first;
      a[i].second = i;
      c[a[i].first]++;
    }
    if (n < 3) {
      cout << "NO\n";
      return 0;
    }
    sort(a + 1, a + n + 1);
    int t2 = 0, t3 = 0, v3, v21, v22;
    for (int i = 1; i <= 2000; i++) {
      if (c[i] == 2) {
        t2++;
        if (t2 == 1)
          v21 = i;
        else {
          v22 = i;
          break;
        }
      }
      if (c[i] > 2) {
        t3++;
        v3 = i;
        break;
      }
    }
    int t21, t22;
    if (t3 == 1) {
      cout << "YES\n";
      for (int i = 1; i <= n; i++) {
        if (a[i].first == v3) {
          t3 = i;
          break;
        }
      }
      for (int i = 1; i <= n; i++) {
        cout << a[i].second << " ";
      }
      cout << endl;
      for (int i = 1; i < t3; i++) {
        cout << a[i].second << " ";
      }
      cout << a[t3 + 1].second << " " << a[t3].second << " ";
      for (int i = t3 + 2; i <= n; i++) {
        cout << a[i].second << " ";
      }
      cout << endl;
      for (int i = 1; i < t3; i++) {
        cout << a[i].second << " ";
      }
      cout << a[t3 + 2].second << " " << a[t3].second << " " << a[t3 + 1].second
           << " ";
      for (int i = t3 + 3; i <= n; i++) {
        cout << a[i].second << " ";
      }
      cout << endl;
    } else if (t2 > 1) {
      cout << "YES\n";
      for (int i = 1; i <= n; i++) {
        if (a[i].first == v21) {
          t21 = i;
          break;
        }
      }
      for (int i = t21 + 2; i <= n; i++) {
        if (a[i].first == v22) {
          t22 = i;
          break;
        }
      }
      for (int i = 1; i <= n; i++) cout << a[i].second << " ";
      cout << endl;
      for (int i = 1; i < t21; i++) cout << a[i].second << " ";
      cout << a[t21 + 1].second << " " << a[t21].second << " ";
      for (int i = t21 + 2; i <= n; i++) cout << a[i].second << " ";
      cout << endl;
      for (int i = 1; i < t22; i++) cout << a[i].second << " ";
      cout << a[t22 + 1].second << " " << a[t22].second << " ";
      for (int i = t22 + 2; i <= n; i++) cout << a[i].second << " ";
      cout << endl;
    } else
      cout << "NO\n";
  }
  return 0;
}
