#include<bits/stdc++.h> using namespace std; using ll=long long; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N,S; cin>>N>>S; vector<int>P(N); vector<pair<int,int>>vp; for(int i=0;i<N;i++){ cin>>P[i]; vp.push_back(make_pair(P[i],i)); } sort(all(vp)); vector<int>id(N); for(int i=0;i<N;i++)id[vp[i].second]=i; vector<int>ans; for(int i=0;i<N;i++){ bool ok=false; if(id[i]>0&&vp[id[i]-1].first>=P[i]-S)ok=true; if(id[i]<N-1&&vp[id[i]+1].first<=P[i]+S)ok=true; if(!ok)ans.push_back(i+1); } cout<<(int)ans.size()<<"\n"; for(auto x:ans)cout<<x<<" "; cout<<"\n"; }