S = int(eval(input()))

mod = (10 ** 9 + 7)

if S < 3:

  print((0))

else:

  ans = 1

  max_length = S // 3

  dp = [[-1 for i in range(S-3+1)] for j in range(max_length+1)]

  for diff_size in range(S-3+1):

    for length in range(max_length+1):

      if length == 0:

        dp[length][diff_size] = 0

      elif length == 1 or diff_size == 0:

        dp[length][diff_size] = 1

      elif length == 2:

        dp[length][diff_size] = diff_size + 1

      elif diff_size == 1:

        dp[length][diff_size] = length

      else:

        if dp[length][diff_size] == -1:

          dp[length][diff_size] = dp[length-1][diff_size] + dp[length][diff_size-1]

  for length in range(2, max_length + 1):

    diff = S - length * 3

    ans += dp[length][diff]

    ans %= mod



  print(ans) 

mod = (10 ** 9 + 7)

tot = 1

l = [1, 0, 0]

for i in range(2000):

  nex = (tot - l[-1] - l[-2]) % mod

  tot = (tot + nex) % mod

  l.append(nex)

print((l[int(eval(input()))]))
S = int(eval(input()))
mod = 10**9 + 7
if S < 3:
    print((0))
else:
    ans = 1
    max_length = S // 3
    dp = [[-1 for i in range(S - 3 + 1)] for j in range(max_length + 1)]
    for diff_size in range(S - 3 + 1):
        for length in range(max_length + 1):
            if length == 0:
                dp[length][diff_size] = 0
            elif length == 1 or diff_size == 0:
                dp[length][diff_size] = 1
            elif length == 2:
                dp[length][diff_size] = diff_size + 1
            elif diff_size == 1:
                dp[length][diff_size] = length
            else:
                if dp[length][diff_size] == -1:
                    dp[length][diff_size] = (
                        dp[length - 1][diff_size] + dp[length][diff_size - 1]
                    )
    for length in range(2, max_length + 1):
        diff = S - length * 3
        ans += dp[length][diff]
        ans %= mod
    print(ans)

mod = 10**9 + 7
tot = 1
l = [1, 0, 0]
for i in range(2000):
    nex = (tot - l[-1] - l[-2]) % mod
    tot = (tot + nex) % mod
    l.append(nex)
print((l[int(eval(input()))]))

-S = int(eval(input())) -if S < 3: -    print((0)) -else: -    ans = 1 -    max_length = S // 3 -    dp = [[-1 for i in range(S - 3 + 1)] for j in range(max_length + 1)] -    for diff_size in range(S - 3 + 1): -        for length in range(max_length + 1): -            if length == 0: -                dp[length][diff_size] = 0 -            elif length == 1 or diff_size == 0: -                dp[length][diff_size] = 1 -            elif length == 2: -                dp[length][diff_size] = diff_size + 1 -            elif diff_size == 1: -                dp[length][diff_size] = length -            else: -                if dp[length][diff_size] == -1: -                    dp[length][diff_size] = ( -                        dp[length - 1][diff_size] + dp[length][diff_size - 1] -                    ) -    for length in range(2, max_length + 1): -        diff = S - length * 3 -        ans += dp[length][diff] -        ans %= mod -    print(ans) +tot = 1 +l = [1, 0, 0] +for i in range(2000): +    nex = (tot - l[-1] - l[-2]) % mod +    tot = (tot + nex) % mod +    l.append(nex) +print((l[int(eval(input()))]))