from functools import*

M=10**9+7

@lru_cache(None)

def f(s):

    if s<3:return 0

    return(sum(map(f,list(range(s-2))))+1)%M

print((f(int(eval(input())))))
a,b,c=1,0,0

exec('a,b,c=b,c,(a+c)%(10**9+7);'*(int(eval(input()))-2))

print(c)
from functools import *

M = 10**9 + 7


@lru_cache(None)
def f(s):
    if s < 3:
        return 0
    return (sum(map(f, list(range(s - 2)))) + 1) % M


print((f(int(eval(input())))))

a, b, c = 1, 0, 0
exec("a,b,c=b,c,(a+c)%(10**9+7);" * (int(eval(input())) - 2))
print(c)

-from functools import * - -M = 10**9 + 7 - - -@lru_cache(None) -def f(s): -    if s < 3: -        return 0 -    return (sum(map(f, list(range(s - 2)))) + 1) % M - - -print((f(int(eval(input()))))) +a, b, c = 1, 0, 0 +exec("a,b,c=b,c,(a+c)%(10**9+7);" * (int(eval(input())) - 2)) +print(c)