n, s = map(int, input().split()) P = list(map(int, input().split())) Q = sorted(P) se = set() for i in range(n): ok = True if i > 0 and Q[i] - Q[i - 1] <= s: ok = False if i < n - 1 and Q[i + 1] - Q[i] <= s: ok = False if ok: se.add(Q[i]) ans = [i for i, p in enumerate(P, 1) if p in se] print(len(ans)) print(*ans)