#include <bits/stdc++.h>
using namespace std;
const int MN = 1e5 + 10;
long long h[MN];
int pai[MN], k[MN];
void printAns(int pos) {
  if (pos != -1) {
    printAns(pai[pos]);
    printf("%d ", pos);
  }
}
int main() {
  int n, d;
  cin >> n >> d;
  for (int i = 1; i <= n; ++i) {
    cin >> h[i];
    k[i] = 1;
    pai[i] = -1;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = max(1, i - 200); j < i; ++j) {
      if (abs(h[i] - h[j]) >= d && k[i] < k[j] + 1) {
        k[i] = k[j] + 1;
        pai[i] = j;
      }
    }
  }
  int ans = -1, pos;
  for (int i = 1; i <= n; ++i) {
    if (ans < k[i]) {
      ans = k[i];
      pos = i;
    }
  }
  cout << ans << '\n';
  printAns(pos);
  cout << '\n';
  return 0;
}
