S = int(eval(input()))

mod = 10**9 + 7

N = 10**6

ans = 0

n = S // 3



fact = [1, 1]

factinv = [1, 1]

inv = [0, 1]





def cmb(n, r):

    if (r < 0) or (n < r):

        return 0

    r = min(r, n - r)

    return fact[n] * factinv[r] * factinv[n - r] % mod





for i in range(2, N + 1):

    fact.append((fact[-1] * i) % mod)

    inv.append((-inv[mod % i] * (mod // i)) % mod)

    factinv.append((factinv[-1] * inv[-1]) % mod)





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

    si = S - i * 3

    ans += cmb(si + i - 1, i - 1)

    ans %= mod



print(ans)





S = int(eval(input()))

mod = 10 ** 9 + 7



DP = [0] * (S+1)



if S >= 3:

    DP[3] = 1



for i in range(4, S+1):

    DP[i] = DP[i-1] + DP[i-3]

    DP[i] %= mod



print((DP[-1]))
S = int(eval(input()))
mod = 10**9 + 7
N = 10**6
ans = 0
n = S // 3
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]


def cmb(n, r):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % mod


for i in range(2, N + 1):
    fact.append((fact[-1] * i) % mod)
    inv.append((-inv[mod % i] * (mod // i)) % mod)
    factinv.append((factinv[-1] * inv[-1]) % mod)
for i in range(1, n + 1):
    si = S - i * 3
    ans += cmb(si + i - 1, i - 1)
    ans %= mod
print(ans)

S = int(eval(input()))
mod = 10**9 + 7
DP = [0] * (S + 1)
if S >= 3:
    DP[3] = 1
for i in range(4, S + 1):
    DP[i] = DP[i - 1] + DP[i - 3]
    DP[i] %= mod
print((DP[-1]))

-N = 10**6 -ans = 0 -n = S // 3 -fact = [1, 1] -factinv = [1, 1] -inv = [0, 1] - - -def cmb(n, r): -    if (r < 0) or (n < r): -        return 0 -    r = min(r, n - r) -    return fact[n] * factinv[r] * factinv[n - r] % mod - - -for i in range(2, N + 1): -    fact.append((fact[-1] * i) % mod) -    inv.append((-inv[mod % i] * (mod // i)) % mod) -    factinv.append((factinv[-1] * inv[-1]) % mod) -for i in range(1, n + 1): -    si = S - i * 3 -    ans += cmb(si + i - 1, i - 1) -    ans %= mod -print(ans) +DP = [0] * (S + 1) +if S >= 3: +    DP[3] = 1 +for i in range(4, S + 1): +    DP[i] = DP[i - 1] + DP[i - 3] +    DP[i] %= mod +print((DP[-1]))