#include <bits/stdc++.h>
const int mx = 1e6 + 5;
const int inf = 0x3f3f3f3f;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  scanf("%d", &n);
  vector<pair<int, int> > v(n);
  map<int, int> dup, cnt;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &v[i].first);
    v[i].second = i + 1;
    ++dup[v[i].first];
  }
  for (auto e : dup) {
    --dup[e.first];
    if (dup[e.first] > 0) cnt[e.first] = dup[e.first] + 1;
  }
  if (cnt.size() <= 1) {
    if (!cnt.size() || cnt.begin()->second == 2) {
      puts("NO");
      return 0;
    }
  }
  sort(v.begin(), v.end());
  puts("YES");
  for (int i = 0; i < n; ++i) printf("%d ", v[i].second);
  puts("");
  int x, y;
  for (int i = 0; i < n; ++i) {
    if (i > 0 && v[i].first == v[i - 1].first) {
      x = v[i - 1].second, y = v[i].second;
      swap(v[i], v[i - 1]);
      break;
    }
  }
  for (int i = 0; i < n; ++i) printf("%d ", v[i].second);
  puts("");
  for (int i = 0; i < n; ++i) {
    if (i > 0 && v[i].first == v[i - 1].first) {
      if (v[i - 1].second == y && v[i].second == x) continue;
      swap(v[i], v[i - 1]);
      break;
    }
  }
  for (int i = 0; i < n; ++i) printf("%d ", v[i].second);
  puts("");
  return 0;
}
