s = int(eval(input()))

mod = 10**9+7

ans = 0

for n in range(1, s//3 + 1):

  left = s - n * 3

  # left -> n

  # left + n - 1 choose n-1

  count = 1

  for i in range(1, n):

    count *= left + i

    count %= mod

  for i in range(1, n):

    count *= pow(i, -1, mod)

    count %= mod

  ans += count

  ans %= mod

print(ans)

  

  
S = int(eval(input()))

f = [0] * (S+1)

f[0] = 1

cumsum = 1

mod = 10**9+7

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

  f[i] = cumsum - f[i-1] - f[i - 2]

  f[i] %= mod

  cumsum += f[i]

print((f[-1]))
s = int(eval(input()))
mod = 10**9 + 7
ans = 0
for n in range(1, s // 3 + 1):
    left = s - n * 3
    # left -> n
    # left + n - 1 choose n-1
    count = 1
    for i in range(1, n):
        count *= left + i
        count %= mod
    for i in range(1, n):
        count *= pow(i, -1, mod)
        count %= mod
    ans += count
    ans %= mod
print(ans)

S = int(eval(input()))
f = [0] * (S + 1)
f[0] = 1
cumsum = 1
mod = 10**9 + 7
for i in range(3, S + 1):
    f[i] = cumsum - f[i - 1] - f[i - 2]
    f[i] %= mod
    cumsum += f[i]
print((f[-1]))

-s = int(eval(input())) +S = int(eval(input())) +f = [0] * (S + 1) +f[0] = 1 +cumsum = 1 -ans = 0 -for n in range(1, s // 3 + 1): -    left = s - n * 3 -    # left -> n -    # left + n - 1 choose n-1 -    count = 1 -    for i in range(1, n): -        count *= left + i -        count %= mod -    for i in range(1, n): -        count *= pow(i, -1, mod) -        count %= mod -    ans += count -    ans %= mod -print(ans) +for i in range(3, S + 1): +    f[i] = cumsum - f[i - 1] - f[i - 2] +    f[i] %= mod +    cumsum += f[i] +print((f[-1]))