#include <bits/stdc++.h>
typedef std::pair<int, int> pii;

template<class T>
using min_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

const int MN = 104;
int N, A[MN], B[MN], prev[MN];
min_heap<pii> pairs;
int main() {
  std::cin.tie(0)->sync_with_stdio(0);
  std::cin >> N;
  for (int i = 1; i <= N; ++i) {
    std::cin >> A[i];
    pairs.emplace(A[i], i);
  }
  int cur = 0;
  while (!pairs.empty()) {
    auto [a, idx] = pairs.top();
    if (a == 1) {
      B[idx] = idx;
      pairs.pop();
    } else if (a > cur + 1) {
      while (!pairs.empty() && pairs.top().first == a) {
        std::vector<int> cycle;
        for (int i = 0; i < a; ++i) {
          if (pairs.empty()) {
            std::cout << "NO\n";
            return 0;
          }
          auto [a1, i1] = pairs.top();
          if (a1 != a) {
            std::cout << "NO\n";
            return 0;
          }
          cycle.push_back(i1);
          pairs.pop();
        }
        for (int i = 0; i < cycle.size(); ++i) {
          B[cycle[i]] = cycle[(i+1) % cycle.size()];
        }
      }
    } else {
      pairs.pop();
      B[idx] = prev[a-1];
    }
    cur = std::max(cur, a);
    prev[a] = idx;
  }
  std::cout << "YES\n";
  for (int i = 1; i <= N; ++i) {
    std::cout << B[i] << " \n"[i==N];
  }
}
