#include #include #include #include using namespace std; typedef long long ll; // pos #define x first // inode #define y second const int maxN = 2e5 + 5; typedef pair star; ll N, S; star P[maxN]; bool judge[maxN]; vector ans; int main() { ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr); cin >> N >> S; for (int i = 1; i <= N; i++) { P[i].y = i; cin >> P[i].x; } sort(P + 1, P + N + 1); memset(judge, true, sizeof(judge)); for (int i = 1; i <= N; i++) { if (i == 1) continue; star pre = P[i - 1]; star now = P[i]; if ( pre.x + S >= now.x) { judge[i - 1] = false; judge[i] = false; } } int cnt = 0; for (int i = 1; i <= N; i++) { if(judge[i]) { cnt++; ans.push_back(P[i].y); } } sort(ans.begin(),ans.end()); cout << cnt << endl; for (auto tmp : ans) cout << tmp << ' '; return 0; }