#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<int, int> a, pair<int, int> b) { return (a.second < b.second); }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, x, d = 0, j = 1;
  bool ok = false;
  cin >> n;
  vector<pair<int, int>> a;
  vector<int> b(3);
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    cin >> x;
    ++m[x];
    if (m[x] == 3) {
      ok = true;
      b[0] = x;
    } else if (m[x] == 2 && d < 2) {
      ++d;
      b[j] = x;
      ++j;
    }
    a.emplace_back(i + 1, x);
  }
  sort(a.begin(), a.end(), cmp);
  if (ok) {
    cout << "YES" << endl;
    for (int j = 0; j < 3; j++) {
      if (j == 0) {
        for (int i = 0; i < n; i++) cout << a[i].first << " ";
      } else if (j == 1) {
        for (int i = 0; i < n; i++) {
          if (a[i].second == b[0] && a[i + 1].second == b[0])
            swap(a[i], a[i + 1]);
          cout << a[i].first << " ";
        }
      } else if (j == 2) {
        for (int i = 0; i < n; i++) {
          if (a[i].second == b[0] && a[i + 2].second == b[0])
            swap(a[i], a[i + 2]);
          cout << a[i].first << " ";
        }
      }
      cout << endl;
    }
  } else if (d == 2) {
    cout << "YES" << endl;
    for (int j = 0; j < 3; j++) {
      if (j == 0) {
        for (auto e : a) cout << e.first << " ";
      } else if (j == 1) {
        for (int i = 0; i < n; i++) {
          if (a[i].second == b[1] && a[i + 1].second == b[1])
            swap(a[i], a[i + 1]);
          cout << a[i].first << " ";
        }
      } else if (j == 2) {
        for (int i = 0; i < n; i++) {
          if (a[i].second == b[2] && a[i + 1].second == b[2])
            swap(a[i], a[i + 1]);
          cout << a[i].first << " ";
        }
      }
      cout << endl;
    }
  } else
    cout << "NO" << endl;
}
