#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    long long arr[n];
    long long same = 0;
    unordered_map<long long, long long> mp;
    int fl = 0;
    vector<pair<int, int> > v;
    for (int i = 0; i < n; i++) {
      long long x;
      cin >> x;
      v.push_back(make_pair(x, i + 1));
      mp[x] += 1;
      if (mp[x] > 1) same++;
    }
    if (same >= 2)
      cout << "YES\n";
    else {
      cout << "NO\n";
      continue;
    }
    sort(v.begin(), v.end());
    vector<int> a, b, c;
    for (int i = 0; i < n; i++) {
      if (mp[v[i].first] > 1 && fl != -1) {
        if (fl == 0) {
          a.push_back(v[i].second);
          a.push_back(v[i + 1].second);
          b.push_back(v[i + 1].second);
          b.push_back(v[i].second);
          if (mp[v[i].first] > 2) {
            c.push_back(v[i + 2].second);
            c.push_back(v[i + 1].second);
            c.push_back(v[i].second);
            a.push_back(v[i + 2].second);
            b.push_back(v[i + 2].second);
            i = i + 2;
            fl = -1;
            continue;
          }
          c.push_back(v[i].second);
          c.push_back(v[i + 1].second);
          i = i + 1;
          fl = 1;
          continue;
        } else if (fl == 1) {
          c.push_back(v[i].second);
          c.push_back(v[i + 1].second);
          a.push_back(v[i + 1].second);
          a.push_back(v[i].second);
          b.push_back(v[i].second);
          b.push_back(v[i + 1].second);
          i = i + 1;
          fl = -1;
          continue;
        }
      } else {
        a.push_back(v[i].second);
        b.push_back(v[i].second);
        c.push_back(v[i].second);
      }
    }
    for (auto i : a) cout << i << " ";
    cout << endl;
    for (auto i1 : b) cout << i1 << " ";
    cout << endl;
    for (auto i2 : c) cout << i2 << " ";
    cout << endl;
  }
  return 0;
}
