use proconio::input;

fn main () {
    input! {
        n: usize,
        s: i64,
        p: [i64; n],
    }
    if n == 1 {
        println!("{}", 1);
        println!("{}", 1);
    }
    else if n == 2 {
        println!("{}", 2);
        println!("{} {}", 1, 2);
    }
    else {
        let mut p = p.iter()
            .enumerate()
            .map(|(i, &x)| {
                (x, i+1)
            })
            .collect::<Vec<_>>();
        p.sort();
        let mut ans = p.windows(3)
            .filter(|w| {
                (w[0].0-w[1].0).abs() > s && (w[2].0-w[1].0).abs() > s
            })
            .collect::<Vec<_>>()
            .iter()
            .map(|&w| {
                w[1].1
            })
            .collect::<Vec<_>>();
        if (p[1].0-p[0].0).abs() > s { ans.push(p[0].1) };
        if (p[n-1].0-p[n-2].0).abs() > s { ans.push(p[n-1].1) };
        ans.sort();
        println!("{}", ans.len());
        println!("{}", ans.iter()
            .map(|&x| x.to_string())
            .collect::<Vec<_>>()
            .join(" "));
    }
}