import sys

from operator import mul

from functools import reduce

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

sys.setrecursionlimit(10 ** 7)



def com(n,r):

    r = min(n-r,r)

    if r == 0: return 1

    over = reduce(mul, list(range(n, n - r, -1)))

    under = reduce(mul, list(range(1,r + 1)))

    return over // under



n = int(readline())

if n < 3:

    print((0))

    sys.exit()



ans = 0

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

    num = n - i * 3

    ans += com(num+i-1,i-1) % 1000000007

    ans %= 1000000007



print(ans)

    

import sys

from operator import mul

from functools import reduce

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

sys.setrecursionlimit(10 ** 7)



def com(n,r):

    r = min(n-r,r)

    if r == 0: return 1 

    return reduce(mul,list(range(n,n-r,-1)))//reduce(mul,list(range(1,r+1)))



n = int(readline())



if n < 3:

    print((0))

    sys.exit()



ans = 0

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

    num = n - i * 3

    ans += com(num+i-1,i-1)

    

print((ans%1000000007))
import sys
from operator import mul
from functools import reduce

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)


def com(n, r):
    r = min(n - r, r)
    if r == 0:
        return 1
    over = reduce(mul, list(range(n, n - r, -1)))
    under = reduce(mul, list(range(1, r + 1)))
    return over // under


n = int(readline())
if n < 3:
    print((0))
    sys.exit()
ans = 0
for i in range(1, n // 3 + 1):
    num = n - i * 3
    ans += com(num + i - 1, i - 1) % 1000000007
    ans %= 1000000007
print(ans)

import sys
from operator import mul
from functools import reduce

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)


def com(n, r):
    r = min(n - r, r)
    if r == 0:
        return 1
    return reduce(mul, list(range(n, n - r, -1))) // reduce(mul, list(range(1, r + 1)))


n = int(readline())
if n < 3:
    print((0))
    sys.exit()
ans = 0
for i in range(1, n // 3 + 1):
    num = n - i * 3
    ans += com(num + i - 1, i - 1)
print((ans % 1000000007))

-    over = reduce(mul, list(range(n, n - r, -1))) -    under = reduce(mul, list(range(1, r + 1))) -    return over // under +    return reduce(mul, list(range(n, n - r, -1))) // reduce(mul, list(range(1, r + 1))) -    ans += com(num + i - 1, i - 1) % 1000000007 -    ans %= 1000000007 -print(ans) +    ans += com(num + i - 1, i - 1) +print((ans % 1000000007))