#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d;
  cin >> n >> d;
  long long h[100010];
  int z[100010], p[100010];
  for (int i = 0; i < n; i++) cin >> h[i];
  for (int i = 0; i < n; i++) {
    z[i] = 1;
  }
  for (int i = 1; i < n; i++) {
    for (int j = max(0, i - 1000); j < i; j++) {
      if (abs(h[i] - h[j]) >= d && z[j] + 1 > z[i]) {
        z[i] = z[j] + 1;
        p[i] = j;
      }
    }
  }
  int max = -100, index;
  for (int i = 0; i < n; i++) {
    if (z[i] > max) {
      max = z[i];
      index = i;
    }
  }
  cout << max << endl;
  vector<int> a;
  a.push_back(index);
  max--;
  while (max > 0) {
    index = p[index];
    a.push_back(index);
    max--;
  }
  for (int i = a.size() - 1; i >= 0; i--) {
    cout << a[i] + 1 << " ";
  }
}
