#include <bits/stdc++.h>
using namespace std;
int l[200000], p[200000];
long long a[200000];
int n, d;
vector<int> v;
int main() {
  cin >> n >> d;
  for (int i = 1; i <= n; i++) cin >> a[i], l[i] = 1, p[i] = i;
  for (int i = 1; i <= n; i++) {
    for (int j = max(1, i - 700); j < i; j++)
      if (abs(a[i] - a[j]) >= d && l[j] + 1 >= l[i]) l[i] = l[j] + 1, p[i] = j;
  }
  int Max = -1, in;
  for (int i = 1; i <= n; i++)
    if (Max < l[i]) Max = l[i], in = i;
  cout << l[in] << endl;
  while (in != p[in]) {
    v.push_back(in);
    in = p[in];
  }
  v.push_back(p[in]);
  for (int i = v.size() - 1; i >= 0; i--) cout << v[i] << " ";
}
