from bisect import bisect_left N,M = map(int,input().split()) A = sorted(list(map(int,input().split()))) ans = 0 if M%2==0: for i in range(N): if A[i]>M//2:break j = bisect_left(A,A[i]+M//2) if j