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: n, k = [int(_) for _ in input().split()]
  a = [int(_) for _ in input().split()]
  dp = [[0 for _ in range(k + 1)] for _ in range(n + 1)]
  for i in range(1, n + 1):
      for j in range(1, k + 1):
          if i >= 2:
              dp[i][j] = dp[i - 1][j] + dp[i - 1][j - 1]
          else:
              dp[i][j] = dp[i - 1][j] + dp[i - 1][j - 1] - dp[i - 2][j - 1]
  print(dp[n][k])
  
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"}]