#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first)
    return a.second < b.second;
  else
    return a.first < b.first;
}
long long exp(long long a, long long b) {
  long long ans = 1;
  while (b != 0) {
    if (b % 2) ans = ans * a;
    a = a * a;
    b /= 2;
  }
  return ans;
}
vector<pair<long long, long long> > v;
vector<pair<long long, long long> > ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long n;
  cin >> n;
  for (long long i = (long long)0; i < (long long)n; i++) {
    long long a;
    cin >> a;
    v.push_back({a, i + 1});
  }
  sort(v.begin(), v.end());
  for (long long i = (long long)1; i < (long long)v.size(); i++) {
    if (v[i - 1].first == v[i].first) {
      ans.push_back({i + 1, i});
    }
    if (ans.size() == 2) break;
  }
  if (ans.size() < 2) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (long long i = (long long)0; i < (long long)v.size(); i++)
    cout << v[i].second << " ";
  cout << endl;
  swap(v[ans[0].first - 1], v[ans[0].second - 1]);
  for (long long i = (long long)0; i < (long long)v.size(); i++) {
    cout << v[i].second << " ";
  }
  cout << endl;
  swap(v[ans[1].first - 1], v[ans[1].second - 1]);
  for (long long i = (long long)0; i < (long long)v.size(); i++)
    cout << v[i].second << " ";
  return 0;
}
