N, S = map(int, input().split()) P = [(i + 1, int(v)) for i, v in enumerate(input().split())] P.sort(key=lambda x: x[1]) P.insert(0, (0, -S-1)) P.append((N + 1, P[-1][1] + S + 1)) ans = [] for i in range(1, N + 1): if P[i][1] - P[i - 1][1] > S and P[i + 1][1] - P[i][1] > S: ans.append(P[i][0]) ans.sort() print(len(ans)) print(' '.join(map(str, ans)))