import sys

input = sys.stdin.readline

INF = 10**18

sys.setrecursionlimit(10**6)

import math

D = 10 ** 9 + 7





# 組み合わせの総数 nCr

def combinations_count(n, r):

    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))



S = int(eval(input()))



max_length = S // 3



total = 0

for i in range(max_length):

    N = (S + i) - 3 * (i + 1)

    add = combinations_count(N, i)

    total += add

    total %= D



print(total)
s = int(eval(input()))

mod = 10**9 + 7



# dp[i]: 最後に切った場所がi

dp = [0]*(s + 1)

dp[0] = 1



for i in range(1, s+1):

    for j in range(0, (i-3)+1):

        dp[i] += dp[j]

        dp[i] %= mod



print((dp[s]))
import sys

input = sys.stdin.readline
INF = 10**18
sys.setrecursionlimit(10**6)
import math

D = 10**9 + 7
# 組み合わせの総数 nCr
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


S = int(eval(input()))
max_length = S // 3
total = 0
for i in range(max_length):
    N = (S + i) - 3 * (i + 1)
    add = combinations_count(N, i)
    total += add
    total %= D
print(total)

s = int(eval(input()))
mod = 10**9 + 7
# dp[i]: 最後に切った場所がi
dp = [0] * (s + 1)
dp[0] = 1
for i in range(1, s + 1):
    for j in range(0, (i - 3) + 1):
        dp[i] += dp[j]
        dp[i] %= mod
print((dp[s]))

-import sys - -input = sys.stdin.readline -INF = 10**18 -sys.setrecursionlimit(10**6) -import math - -D = 10**9 + 7 -# 組み合わせの総数 nCr -def combinations_count(n, r): -    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) - - -S = int(eval(input())) -max_length = S // 3 -total = 0 -for i in range(max_length): -    N = (S + i) - 3 * (i + 1) -    add = combinations_count(N, i) -    total += add -    total %= D -print(total) +s = int(eval(input())) +mod = 10**9 + 7 +# dp[i]: 最後に切った場所がi +dp = [0] * (s + 1) +dp[0] = 1 +for i in range(1, s + 1): +    for j in range(0, (i - 3) + 1): +        dp[i] += dp[j] +        dp[i] %= mod +print((dp[s]))