#include <bits/stdc++.h>
using namespace std;
struct sort_pred {
  bool operator()(const std::pair<int, int> &left,
                  const std::pair<int, int> &right) {
    return left.second < right.second;
  }
};
void optimise() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long int gcd(long long int m, long long int n) {
  if (n == 0) return m;
  return gcd(n, m % n);
}
long long powmod(long long a, long long b) {
  if (b == 0) return 1;
  long long x = powmod(a, b / 2);
  long long y = (x * x) % 1000000007;
  if (b % 2) return (a * y) % 1000000007;
  return y % 1000000007;
}
int main() {
  int n;
  cin >> n;
  vector<int> v[2010];
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    int h;
    cin >> h;
    v[h].push_back(i);
  }
  int flag = 0;
  int ind;
  for (__typeof(2010) i = (0) - ((0) > (2010)); i != (2010) - ((0) > (2010));
       i += 1 - 2 * ((0) > (2010))) {
    if ((int)(v[i].size()) >= 3) {
      flag = 1;
      ind = i;
      break;
    }
  }
  if (flag == 1) {
    cout << "YES\n";
    for (__typeof(3) tt = (0) - ((0) > (3)); tt != (3) - ((0) > (3));
         tt += 1 - 2 * ((0) > (3))) {
      for (__typeof(2010) i = (0) - ((0) > (2010));
           i != (2010) - ((0) > (2010)); i += 1 - 2 * ((0) > (2010))) {
        if (i != ind) {
          for (__typeof((int)(v[i].size())) j =
                   (0) - ((0) > ((int)(v[i].size())));
               j != ((int)(v[i].size())) - ((0) > ((int)(v[i].size())));
               j += 1 - 2 * ((0) > ((int)(v[i].size()))))
            cout << v[i][j] + 1 << " ";
        } else {
          for (__typeof((int)(v[i].size())) j =
                   (0) - ((0) > ((int)(v[i].size())));
               j != ((int)(v[i].size())) - ((0) > ((int)(v[i].size())));
               j += 1 - 2 * ((0) > ((int)(v[i].size()))))
            cout << v[i][j] + 1 << " ";
          next_permutation(v[i].begin(), v[i].end());
        }
      }
      cout << "\n";
    }
  } else {
    vector<int> index;
    for (__typeof(2010) i = (0) - ((0) > (2010)); i != (2010) - ((0) > (2010));
         i += 1 - 2 * ((0) > (2010))) {
      if ((int)(v[i].size()) == 2) {
        index.push_back(i);
        if ((int)(index.size()) == 2) break;
      }
    }
    if ((int)(index.size()) == 2) {
      cout << "YES\n";
      for (__typeof(3) tt = (0) - ((0) > (3)); tt != (3) - ((0) > (3));
           tt += 1 - 2 * ((0) > (3))) {
        for (__typeof(2010) i = (0) - ((0) > (2010));
             i != (2010) - ((0) > (2010)); i += 1 - 2 * ((0) > (2010))) {
          if (i == index[0] && tt == 0) {
            for (__typeof((int)(v[i].size())) j =
                     (0) - ((0) > ((int)(v[i].size())));
                 j != ((int)(v[i].size())) - ((0) > ((int)(v[i].size())));
                 j += 1 - 2 * ((0) > ((int)(v[i].size()))))
              cout << v[i][j] + 1 << " ";
            next_permutation(v[i].begin(), v[i].end());
          } else if (i == index[1] && tt != 0) {
            for (__typeof((int)(v[i].size())) j =
                     (0) - ((0) > ((int)(v[i].size())));
                 j != ((int)(v[i].size())) - ((0) > ((int)(v[i].size())));
                 j += 1 - 2 * ((0) > ((int)(v[i].size()))))
              cout << v[i][j] + 1 << " ";
            next_permutation(v[i].begin(), v[i].end());
          } else {
            for (__typeof((int)(v[i].size())) j =
                     (0) - ((0) > ((int)(v[i].size())));
                 j != ((int)(v[i].size())) - ((0) > ((int)(v[i].size())));
                 j += 1 - 2 * ((0) > ((int)(v[i].size()))))
              cout << v[i][j] + 1 << " ";
          }
        }
        cout << "\n";
      }
    } else
      cout << "NO\n";
  }
  return 0;
}
