output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K
      A_1
      A_2
      :
      A_N
attempt: n, k = map(int, input().split())
  a = [None] * n
  m = 0
  lian = 0
  a0 = int(input())
  a[0] = a0
  for i in range(1, n):
      a1 = int(input())
      a[i] = a1
      if a1 - a0 > k:
          pass
      elif a0 - a1 > k:
          pass
      else:
          lian += 1
          if lian > m:
              m = lian
          a0 = int(a1)
  m1 = 0
  lian = 0
  a0 = a[n - 1]
  for i in range(2, n + 1):
      a1 = a[n - i]
      if a1 - a0 > k:
          pass
      elif a0 - a1 > k:
          pass
      else:
          lian += 1
          if lian > m1:
              m1 = lian
          a0 = int(a1)
  if m > m1:
      print(m + 1)
  else:
      print(m1 + 1)
  
problem_description: Statement
  
  You are given a sequence A_1, A_2, ..., A_N and an integer K.
  
  Print the maximum possible length of a sequence B that satisfies the following
  conditions:
  
    * B is a (not necessarily continuous) subsequence of A.
    * For each pair of adjacents elements of B, the absolute difference of the elements is at most K.
samples: [{"input": "10 3\n    1\n    5\n    4\n    3\n    8\n    6\n    9\n    7\n    2\n    4", "output": "7\n    \n\nFor example, B = (1, 4, 3, 6, 9, 7, 4) satisfies the conditions.\n\n  * It is a subsequence of A = (1, 5, 4, 3, 8, 6, 9, 7, 2, 4).\n  * All of the absolute differences between two adjacent elements (|1-4|, |4-3|, |3-6|, |6-9|, |9-7|, |7-4|) are at most K = 3."}]