output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: from typing import List, Any
  
  
  def read_int() -> int:
      return int(input().strip())
  
  
  def read_ints() -> List[int]:
      return list(map(int, input().strip().split(" ")))
  
  
  def solve() -> Any:
      S = read_int()
      dp = [[0 for _ in range(S + 1)] for _ in range(S // 3 + 1)]
      prefix = [1] * (S + 1)
      new_prefix = [0] * (S + 1)
      modulo = 10**9 + 7
      for i in range(1, S // 3 + 1):
          for j in range(1, S + 1):
              if i > 0 and j >= 3:
                  dp[i][j] = (dp[i][j] + prefix[j - 3]) % modulo
              new_prefix[j] = (new_prefix[j - 1] + dp[i][j]) % modulo
          prefix, new_prefix = new_prefix, prefix
          new_prefix[0] = 0
      # dp[i][j] = dp[i-1][j-k] # i number of elements such that sum is j, 3 <= k <= 9
      return sum(dp[i][S] for i in range(1, S // 3 + 1)) % modulo
  
  
  if __name__ == "__main__":
      print(solve())
  
problem_description: Statement
  
  Given is an integer S. Find how many sequences there are whose terms are all
  integers greater than or equal to 3, and whose sum is equal to S. The answer
  can be very large, so output it modulo 10^9 + 7.
samples: [{"input": "7", "output": "3\n    \n\n3 sequences satisfy the condition: \\\\{3,4\\\\}, \\\\{4,3\\\\} and \\\\{7\\\\}.\n\n* * *"}, {"input": "2", "output": "0\n    \n\nThere are no sequences that satisfy the condition.\n\n* * *"}, {"input": "1729", "output": "294867501"}]