#include using namespace std; using ll = long long; const int INF = 1e9 + 10; const ll INFL = 4e18; int main() { int N, S; cin >> N >> S; vector A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } vector> P(N); for (int i = 0; i < N; i++) { P[i] = {A[i], i}; } sort(P.begin(), P.end()); vector ans; for (int i = 0; i < N; i++) { bool ok = true; if (i > 0) { if (P[i - 1].first >= P[i].first - S) { ok = false; } } if (i < N - 1) { if (P[i + 1].first <= P[i].first + S) { ok = false; } } if (ok) { ans.push_back(P[i].second); } } sort(ans.begin(), ans.end()); cout << ans.size() << endl; for (int x : ans) { cout << ++x << ' '; } cout << endl; }