#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  pair<int, int> p[n];
  for (int i = 0; i < n; i++) {
    cin >> p[i].first;
    p[i].second = i;
  }
  sort(p, p + n);
  int cnt = 0, l = 1;
  bool con = false;
  for (int i = 0; i < n - 1; i++) {
    if (p[i].first == p[i + 1].first) {
      if (!con) cnt++;
      l++, con = true;
      if (l >= 3) break;
    }
    if (l > 2 || cnt >= 2) break;
    if (p[i].first != p[i + 1].first) l = 1, con = false;
  }
  if (l <= 2 && cnt < 2)
    cout << "NO";
  else {
    cout << "YES"
         << "\n";
    if (l > 2) {
      int index, l = 1;
      for (int i = 0; i < n - 1; i++) {
        if (p[i].first == p[i + 1].first) {
          l++;
          if (l == 2)
            index = i;
          else
            break;
        }
        if (p[i].first != p[i + 1].first) l = 1;
      }
      for (int x = 0; x <= 2; x++) {
        int ans[n];
        swap(p[index + x].second, p[index + (x + 1) % 3].second);
        for (int i = 0; i < n; i++) {
          ans[i] = p[i].second + 1;
        }
        for (int i = 0; i < n; i++) {
          cout << ans[i] << " ";
        }
        cout << "\n";
      }
    } else {
      int index1 = -1, index2;
      for (int i = 0; i < n - 1; i++) {
        if (p[i].first == p[i + 1].first) {
          if (index1 == -1)
            index1 = i;
          else {
            index2 = i;
            break;
          }
        }
      }
      for (int x = 0; x <= 2; x++) {
        int ans[n];
        if (x == 1) swap(p[index1].second, p[index1 + 1].second);
        if (x == 2) swap(p[index2].second, p[index2 + 1].second);
        for (int i = 0; i < n; i++) {
          ans[i] = p[i].second + 1;
        }
        for (int i = 0; i < n; i++) {
          cout << ans[i] << " ";
        }
        cout << "\n";
      }
    }
  }
  return 0;
}
