n=int(input())
mod=10**9+7
dp=[0]*(10**6+1)
dp[1]=1
dp[2]=2
dp[3]=2
for i in range(4,n+1):
    dp[i]=(dp[i-3]+dp[i-2])%mod
print(dp[n])