#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a[2002];
int b[2002];
vector<int> ans[4];
void Work() {
  int l;
  int maxT = 0;
  int specialNum = -1;
  for (int i = 0; i < n; i++) {
    cin >> l;
    a[l].push_back(i + 1);
    if (l > maxT) maxT = l;
    b[l]++;
    if (b[l] >= 3) specialNum = l;
  }
  int check = 0;
  for (int i = 0; i <= maxT; i++) {
    if (b[i] >= 2) check++;
    if (b[i] >= 3) check++;
    if (check == 2) break;
  }
  if (check < 2) {
    cout << "NO";
    return;
  }
  for (int i = 1; i <= maxT; i++) {
    for (int j = 0; j < a[i].size(); j++) {
      if (a[i][j] > 0) {
        ans[1].push_back(a[i][j]);
      }
    }
  }
  for (int i = 1; i <= maxT; i++) {
    for (int j = a[i].size() - 1; j >= 0; j--) {
      if (a[i][j] > 0) {
        ans[2].push_back(a[i][j]);
      }
    }
  }
  bool tt = false;
  if (specialNum == -1)
    for (int i = 1; i <= maxT; i++) {
      if (b[i] >= 2 && !tt) {
        for (int j = a[i].size() - 1; j >= 0; j--) {
          if (a[i][j] > 0) {
            ans[3].push_back(a[i][j]);
            tt = true;
          }
        }
      } else {
        for (int j = 0; j < a[i].size(); j++) {
          if (a[i][j] > 0) {
            ans[3].push_back(a[i][j]);
          }
        }
      }
    }
  else {
    for (int i = 1; i <= specialNum; i++) {
      if (i != specialNum)
        for (int j = a[i].size() - 1; j >= 0; j--) {
          if (a[i][j] > 0) {
            ans[3].push_back(a[i][j]);
            tt = true;
          }
        }
    }
    for (int i = 0; i < a[specialNum].size() / 2; i++) {
      if (a[specialNum][i] > 0) {
        ans[3].push_back(a[specialNum][i]);
      }
    }
    for (int i = a[specialNum].size() - 1; i >= a[specialNum].size() / 2; i--) {
      if (a[specialNum][i] > 0) {
        ans[3].push_back(a[specialNum][i]);
      }
    }
    for (int i = specialNum + 1; i <= maxT; i++) {
      if (i != specialNum)
        for (int j = a[i].size() - 1; j >= 0; j--) {
          if (a[i][j] > 0) {
            ans[3].push_back(a[i][j]);
            tt = true;
          }
        }
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= 3; i++) {
    for (int j = 0; j < ans[i].size(); j++) {
      cout << ans[i][j];
      if (j < ans[i].size() - 1) cout << " ";
    }
    if (i != 3) cout << endl;
  }
}
int main() {
  cin >> n;
  Work();
}
