#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a[2001];
  long unsigned int count_max = 0;
  int count_max_index = -1;
  int p;
  for (int i = 0; i < n; ++i) {
    cin >> p;
    a[p].push_back(i + 1);
    if (a[p].size() > count_max) {
      count_max = a[p].size();
      count_max_index = p;
    }
  }
  if (count_max >= 3) {
    cout << "YES\n";
    int count1 = 0;
    for (int i1 = 0; i1 < 3; ++i1) {
      for (int i = 1; i < 2001; i++) {
        if (i == count_max_index) {
          for (int j = 0; j < a[i].size(); ++j) {
            cout << a[i][(j + count1) % a[i].size()] << " ";
          }
          count1++;
        } else {
          for (int j = 0; j < a[i].size(); ++j) {
            cout << a[i][j] << " ";
          }
        }
      }
      cout << "\n";
    }
  } else if (count_max <= 1) {
    cout << "NO\n";
  } else if (count_max == 2) {
    vector<int> b;
    for (int i = 1; i < 2001; ++i) {
      if (a[i].size() == 2) b.push_back(i);
      if (b.size() == 2) break;
    }
    if (b.size() < 2) {
      cout << "NO\n";
      return 0;
    }
    cout << "YES\n";
    int perm1 = 0, perm2 = 0;
    for (int j = 0; j < 3; j++) {
      for (int i = 1; i < 2001; i++) {
        if (i == b[0]) {
          cout << a[i][perm1] << " " << a[i][(perm1 + 1) % 2] << " ";
          if (perm2 == 1) perm1 = (perm1 + 1) % 2;
        } else if (i == b[1]) {
          cout << a[i][perm2] << " " << a[i][(perm2 + 1) % 2] << " ";
          perm2 = (perm2 + 1) % 2;
        } else {
          for (int j1 = 0; j1 < a[i].size(); ++j1) {
            cout << a[i][j1] << " ";
          }
        }
      }
      cout << "\n";
    }
  }
}
