#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
template<typename T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template<typename T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
void solve();
int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  cout << fixed << setprecision(20);
  int t = 1;
  //cin >> t;
  while (t--) {
    solve();
  }
}
int N,S,P[2<<17];
multiset<int>st;
void solve() {
  cin>>N>>S;
  rep(i,N)cin>>P[i];

  rep(i,N)st.insert(P[i]);
  vector<int>ans;
  rep(i,N){
    bool flag=1;
    auto it=st.lower_bound(P[i]);
    if(it!=st.begin()){
      --it;
      if(P[i]-*it<=S)flag=0;
      ++it;
    }
    ++it;
    if(it!=st.end()){
      if(*it-P[i]<=S)flag=0;
    }
    if(flag)ans.emplace_back(i);
  }
  cout<<ans.size()<<endl;
  rep(i,ans.size())cout<<ans[i]+1<<" \n"[i+1==(int)ans.size()];
}