#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int N;
  cin >> N;
  vector<int> A(N), pre(N, -1), DP(N, 0);
  for (int i = (0); i < (N); ++i) {
    cin >> A[i];
    if (A[i] < 1) continue;
    if (A[i] == 1) {
      DP[i] = 1;
      continue;
    }
    for (int j = (0); j < (i); ++j)
      if (A[j] + 1 == A[i] && DP[j] == A[j]) DP[i] = DP[j] + 1, pre[i] = j;
  }
  int res = 0, make_pair = -1;
  for (int i = (0); i < (N); ++i)
    if (res < DP[i]) res = DP[i], make_pair = i;
  printf("%d\n", res);
  if (make_pair != -1) {
    deque<int> stk;
    while (make_pair != -1) {
      stk.push_front(2001 + make_pair);
      make_pair = pre[make_pair];
    }
    for (int i = (0); i < (stk.size()); ++i)
      printf("%d%c", stk[i], (i + 1 == stk.size()) ? '\n' : ' ');
  }
  return 0;
}
