#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<pair<int, int> > vp;
  vector<int> fin[2001];
  vector<int> v;
  map<int, int> ma;
  int n, temp;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    vp.push_back(make_pair(temp, i + 1));
    ma[temp]++;
  }
  sort(vp.begin(), vp.end());
  int twocou = 0, moretwo = 0, save1 = -1, flag1 = -1, flag2 = -1;
  for (map<int, int>::iterator mit = ma.begin(); mit != ma.end(); mit++) {
    if (((mit)->second) == 2) {
      twocou++;
    } else if (((mit)->second) > 2) {
      moretwo++;
    }
  }
  if (twocou >= 2 || moretwo >= 1) {
    cout << "YES\n";
    temp = vp.begin()->first;
    for (vector<pair<int, int> >::iterator it = vp.begin(); it != vp.end();
         ++it) {
      cout << it->second << " ";
      fin[(it->first) - 1].push_back(it->second);
    }
    cout << endl;
    for (int i = 0; i < 2001; i++) {
      int len = fin[i].size();
      if (len != 0) {
        if (flag1 == -1) {
          if (len == 1) {
            cout << fin[i][0] << " ";
          } else if (len == 2) {
            for (int j = 0; j < len; j++) {
              cout << fin[i][(j + 1) % len] << " ";
            }
            flag1 = 0;
            save1 = i;
          } else {
            for (int j = 0; j < len; j++) {
              cout << fin[i][(j + 1) % len] << " ";
            }
            flag1 = 0;
          }
        } else {
          for (int j = 0; j < len; j++) {
            cout << fin[i][j] << " ";
          }
        }
      }
    }
    cout << endl;
    for (int i = 0; i < 2001; i++) {
      int len = fin[i].size();
      if (len != 0) {
        if (flag2 == -1) {
          if (i != save1) {
            if (len == 1) {
              cout << fin[i][0] << " ";
            } else if (len == 2) {
              for (int j = 0; j < len; j++) {
                cout << fin[i][(j + 1) % len] << " ";
              }
              flag2 = 0;
            } else {
              for (int j = 0; j < len; j++) {
                cout << fin[i][(j + 2) % len] << " ";
              }
              flag1 = 0;
              save1 = i;
            }
          } else {
            for (int j = 0; j < len; j++) {
              cout << fin[i][j] << " ";
            }
          }
        } else {
          for (int j = 0; j < len; j++) {
            cout << fin[i][j] << " ";
          }
        }
      }
    }
    cout << endl;
  } else {
    cout << "NO\n";
  }
  return 0;
}
