using System;
using System.Collections.Generic;
using System.Linq;

namespace ACLBeginnerContest
{
    class Program
    {
        static void Main(string[] args)
        {
            // 課題D - Flat Subsequence(2020/9/27)

            string[] str = Console.ReadLine().Split(' ');
            int N = int.Parse(str[0]);
            int K = int.Parse(str[1]);
            List<int> A = new List<int>();

            for (int i = 0; i < N; i++)
            {
                A.Add(int.Parse(Console.ReadLine()));
            }

            int x=0, y=1;
            int start = N;
            int result;

            while (y < N)
            {
                result = Math.Abs(A[x] - A[y]);
                if (result <= K)
                {
                    if(start > y) start = y;
                    x++;
                    y = x + 1;
                }
                else y++;
                if (x >= start) break;
            }

            int cnt = 2;
            x = start;
            y = start + 1;

            while (y < N)
            {
                result = Math.Abs(A[x] - A[y]);
                if (result <= K)
                {
                    cnt++;
                    x = y;
                    y++;
                }
                else y++;

            }

            Console.Write(cnt);
        }
    }


}