#include <bits/stdc++.h>
using namespace std;
bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
  return a.second < b.second;
}
vector<int> swap(vector<int> v, int a, int b) {
  for (int i = 0; i < v.size(); i++) {
    if (v[i] == a) {
      v[i] = b;
    } else if (v[i] == b) {
      v[i] = a;
    }
  }
  return v;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  vector<pair<int, int>> tasks;
  cin >> n;
  int a, b;
  for (int i = 0; i < n; i++) {
    cin >> a;
    tasks.push_back(make_pair(i, a));
  }
  sort(tasks.begin(), tasks.end(), cmp);
  int v = tasks[0].second;
  int count = 1;
  vector<vector<int>> swaps;
  for (int i = 1; i < n; i++) {
    if (v == tasks[i].second) {
      count++;
    } else {
      if (count == 2) {
        vector<int> task;
        task.push_back(tasks[i - 1].first);
        task.push_back(tasks[i - 2].first);
        swaps.push_back(task);
      } else if (count > 2) {
        vector<int> task;
        task.push_back(tasks[i - 1].first);
        task.push_back(tasks[i - 2].first);
        task.push_back(tasks[i - 3].first);
        swaps.push_back(task);
        count = 1;
        break;
      }
      count = 1;
    }
    v = tasks[i].second;
  }
  if (count == 2) {
    vector<int> task;
    task.push_back(tasks[n - 1].first);
    task.push_back(tasks[n - 2].first);
    swaps.push_back(task);
  } else if (count > 2) {
    vector<int> task;
    task.push_back(tasks[n - 1].first);
    task.push_back(tasks[n - 2].first);
    task.push_back(tasks[n - 3].first);
    swaps.push_back(task);
  }
  bool flag = false;
  if (swaps.size() > 1) flag = true;
  if (swaps.size() == 1 && swaps[0].size() >= 3) flag = true;
  if (flag) {
    cout << "YES\n";
    vector<int> va;
    va.push_back(tasks[0].first);
    cout << va[0] + 1;
    for (int i = 1; i < n; i++) {
      va.push_back(tasks[i].first);
      cout << " " << va[i] + 1;
    }
    cout << endl;
    vector<int> v2 = swap(va, swaps[0][0], swaps[0][1]);
    cout << v2[0] + 1;
    for (int i = 1; i < n; i++) {
      cout << " " << v2[i] + 1;
    }
    cout << endl;
    if (swaps[0].size() > 2) {
      v2 = swap(va, swaps[0][1], swaps[0][2]);
    } else {
      v2 = swap(va, swaps[1][0], swaps[1][1]);
    }
    cout << v2[0] + 1;
    for (int i = 1; i < n; i++) {
      cout << " " << v2[i] + 1;
    }
    cout << endl;
  } else {
    cout << "NO\n";
  }
}
