MOD = 10**9+7



MAX = 1000010

fac = [0] * MAX 

finv = [0] * MAX

inv = [0] * MAX

def COMinit():

    fac[0] = fac[1] = 1

    finv[0] = finv[1] = 1

    inv[1] = 1

    for i in range(2, MAX):

        fac[i] = fac[i-1] * i % MOD

        inv[i] = MOD - inv[MOD%i] * (MOD//i) % MOD

        finv[i] = finv[i-1] * inv[i] % MOD



def COM(n, k):

    res = 1

    for i in range(k):

        res = res * (n-i) % MOD

    return res * finv[k] % MOD





s = int(eval(input()))

x = s//3



COMinit()

ans = 0



for i in range(x):

    ans = (ans + COM(s-2*(i+1)-1, i)) % MOD

    #print(COM(s-2*(i+1)-1, i))

print(ans)
MOD = 10**9+7

s = int(eval(input()))

x = s//3



MAX = s+1

fac = [0] * MAX 

finv = [0] * MAX

inv = [0] * MAX

def COMinit():

    fac[0] = fac[1] = 1

    finv[0] = finv[1] = 1

    inv[1] = 1

    for i in range(2, MAX):

        fac[i] = fac[i-1] * i % MOD

        inv[i] = MOD - inv[MOD%i] * (MOD//i) % MOD

        finv[i] = finv[i-1] * inv[i] % MOD



def COM(n, k):

    res = 1

    for i in range(k):

        res = res * (n-i) % MOD

    return res * finv[k] % MOD





COMinit()

ans = 0



for i in range(x):

    ans = (ans + COM(s-2*(i+1)-1, i)) % MOD

    #print(COM(s-2*(i+1)-1, i))

print(ans)

MOD = 10**9 + 7
MAX = 1000010
fac = [0] * MAX
finv = [0] * MAX
inv = [0] * MAX


def COMinit():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX):
        fac[i] = fac[i - 1] * i % MOD
        inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD


def COM(n, k):
    res = 1
    for i in range(k):
        res = res * (n - i) % MOD
    return res * finv[k] % MOD


s = int(eval(input()))
x = s // 3
COMinit()
ans = 0
for i in range(x):
    ans = (ans + COM(s - 2 * (i + 1) - 1, i)) % MOD
    # print(COM(s-2*(i+1)-1, i))
print(ans)

MOD = 10**9 + 7
s = int(eval(input()))
x = s // 3
MAX = s + 1
fac = [0] * MAX
finv = [0] * MAX
inv = [0] * MAX


def COMinit():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX):
        fac[i] = fac[i - 1] * i % MOD
        inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD


def COM(n, k):
    res = 1
    for i in range(k):
        res = res * (n - i) % MOD
    return res * finv[k] % MOD


COMinit()
ans = 0
for i in range(x):
    ans = (ans + COM(s - 2 * (i + 1) - 1, i)) % MOD
    # print(COM(s-2*(i+1)-1, i))
print(ans)

-MAX = 1000010 +s = int(eval(input())) +x = s // 3 +MAX = s + 1 -s = int(eval(input())) -x = s // 3