output_description: Print the number of subsequences that satisfy the condition.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K
      A_1 A_2 \cdots A_N
attempt: # 変数名の付け方の注意！ 配列や集合は大文字！（なぜなら数がたくさんあるから）
  #                   要素は小文字（なぜなら１個しかないから）
  A = [1, 5, 7, 15, 26, 45, 60, 256]
  
  x = int(input())
  
  li = 0
  ri = len(A) - 1
  
  while li != ri:
      print(li, ri)
      print("", A[li], A[ri])
      mi = (li + ri) // 2
      if A[mi] < x:
          li = mi + 1
      elif A[mi] > x:
          ri = mi - 1
      else:
          li = mi
          ri = mi
          print("HIT")
  if A[li] == x:
      print("発見！", li)
  else:
      print("ないよ！")
  
problem_description: Statement
  
  Given are a sequence of N positive integers A_1, A_2, \ldots, A_N, and a
  positive integer K.
  
  Find the number of non-empty contiguous subsequences in A such that the
  remainder when dividing the sum of its elements by K is equal to the number of
  its elements. We consider two subsequences different if they are taken from
  different positions, even if they are equal sequences.
samples: [{"input": "5 4\n    1 4 2 3 5", "output": "4\n    \n\nFour sequences satisfy the condition: (1), (4,2), (1,4,2), and (5).\n\n* * *"}, {"input": "8 4\n    4 2 4 2 4 2 4 2", "output": "7\n    \n\n(4,2) is counted four times, and (2,4) is counted three times.\n\n* * *"}, {"input": "10 7\n    14 15 92 65 35 89 79 32 38 46", "output": "8"}]