import os, sys import math, decimal, queue, heapq, bisect, itertools, functools, collections, string from bisect import bisect, bisect_left from collections import defaultdict, OrderedDict, deque, Counter from functools import cmp_to_key, lru_cache, reduce from heapq import heapify, heappush, heappushpop, heappop, heapreplace, nlargest, nsmallest from itertools import accumulate, chain, combinations, combinations_with_replacement, compress, count, cycle, dropwhile, filterfalse, groupby, islice, permutations, product, repeat, starmap, takewhile, tee, zip_longest from math import gcd, factorial, isqrt, comb, perm, prod, inf from queue import Queue, PriorityQueue, LifoQueue from string import ascii_letters, ascii_lowercase, ascii_uppercase, digits, hexdigits, octdigits az, AZ, mod = ascii_lowercase, ascii_uppercase, 1_000_000_007 def solve(): def run(W): n, s = W[0] p = sorted((n, i + 1) for i, n in enumerate(W[1])) if len(p) < 2: print(1) print(1) else: res = [] # P(p, n, s, '\n') lo, hi = set(), set() for i, (st, idx) in enumerate(p): if i == 0: continue dist = abs(p[i][0] - p[i - 1][0]) if dist <= s: lo.update({p[i][1], p[i - 1][1]}) s = sorted(lo) j = 0 for i in range(1, n + 1): if j < len(s) and s[j] == i: j += 1 else: res.append(i) print(len(res)) PI(*res) # PI(i, st, idx, res, lo, '\n') run(W) if __name__ == '__main__': LOCAL = sys.argv[0] if '4a' in sys.argv[0] else None P = lambda *p: [print(i, end=' ') for i in p] if LOCAL else None PI = lambda *p: print(' '.join(map(str, p))) or None PII = lambda X: [PI(*row) for row in X] sys.stdin = open(os.path.join(os.getcwd(), 'a1.txt'), 'r') if LOCAL else sys.stdin I = lambda: [int(a) for l in sys.stdin for a in l.strip().split()] S = lambda: [a for l in sys.stdin for a in l.strip().split()] IM = lambda: [[int(a) for a in l.split()] for l in sys.stdin] SM = lambda: [[a for a in l.split()] for l in sys.stdin] W = IM() # P(W) solve()