//THE DOC

#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
typedef long long int ll;
typedef unsigned long long int ull;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
ll mod1=pow(10,9)+7;
int mod2=998244353;
ll inf=1e9;
ll maxxy=1e6+9;
typedef long double ld;
const double PI =  3.141592653589793238;

//NUMBER THEORY
//(a-b)%c=((a%c)-((b%c))+c)%c;
//to find gcd use function __gcd(x,y);

//Seive of erathonesis(finding prime numbers till n)
/*
 *
 *
************************************************************************
       vector<bool> isPrime(n+1,true);
        isPrime[0] = false;
        isPrime[1] = false;
        for(int i = 2; i * i <= N; ++i) {
             if(isPrime[i] == true) {
                 for(int j = i * i; j <= N ;j += i)
                     isPrime[j] = false;
            }
        }
*************************************************************************

*/
//Prime Factorisation of numbers of large orders like 1e9,1e12 in O(sqrt(N))
/*
 *
 **********************************************************************
 vector<ll> res;
    for (int i = 2; i * i <= n; ++i) {
        while (n % i == 0) {
            res.push_back(i);
            n /= i;
        }
    }
    if (n != 1) {
        res.push_back(n);
    }
 ***********************************************************************

 */
//Prime Factors of numbers of order 1e5,1e6 in O(logn) using seive
/*
 *
 ***********************************************************************
 //max_value is upper limit of elements we have to factorise
 vector<ll> minPrime(max_value + 1,0);
for (int i = 2; i * i <= max_value; ++i) {
    if (minPrime[i] == 0) {         //If i is prime
        for (int j = i * i; j <= max_value; j += i) {
            if (minPrime[j] == 0) {
                minPrime[j] = i;
            }
        }
    }
}
for (int i = 2; i <= max_value; ++i) {
    if (minPrime[i] == 0) {
        minPrime[i] = i;
    }
}
//factorising array of elements in log(n)
 for(int i=0;i<n;i++){
     vector<ll> res;
    while (a[i] != 1) {
        res.push_back(minPrime[a[i]]);
        a[i] /= minPrime[a[i]];
    }
 }
 ****************************************************************

 */
ll add_self(ll a,ll b){
    a+=b;
    if(a>=mod1)
        a-=mod1;
    return a;
}
ll sub_self(ll a,ll b){
    a-=b;
    if(a<0)
        a+=mod1;
    return a;
}

//to get sum of b consecutive non negative integers starting from a
ull sumcons(ull a,ull b){
    if(a==0){
        return (b*(b-1))/2;
    }
    else{
        ull zzz=(b*(b+1))/2;
        zzz+=((a-1)*b);
        return zzz;
    }
}
ll power(ll x, ll y, ll pp)
{
    ll res = 1;
    x = x % pp;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % pp;
        y = y>>1;
        x = (x*x) % pp;
    }
    return res;
}

ll modInverse(ll n, ll pp)
{
    return power(n, pp-2, pp);
}
ll compute_hash(string const& s){
     const ll p=31;//use 53 if uppercase also there
     const ll m=1e9+9;
     ll hash_value=0;
     ll p_pow=1;
     for(char c:s){
         hash_value+=(ll)(c-'a'+1)*p_pow;
         hash_value%=m;
         (p_pow*=p)%=m;
     }
     return hash_value;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll s;
    cin>>s;
    ll dp[s+1][s/3+1];
    ll ans=0;
    ll fact[s+1];
    fact[0]=1;
    for (int l = 1; l <=s ; ++l) {
        fact[l]=l*fact[l-1];
        fact[l]%=mod1;
    }
    for (int i = 0; i <=s ; ++i) {
        for (int j = 1; j <=s/3 ; ++j) {
                if(i/j<3){
                    dp[i][j]=0;
                }
                else{
                    ll k=i-(3*j);
                    ll up=k+j-1;
                    ll r=j-1;
                    ll kk=fact[up];
                    kk*=modInverse(fact[r],mod1)%mod1;
                    kk%=mod1;
                    kk*=modInverse(fact[up-r],mod1)%mod1;
                    kk%=mod1;
                    dp[i][j]=kk;
                }
            if(i==s){
                ans+=dp[i][j];
                ans%=mod1;
            }
          //  cout<<i<<" "<<j<<" "<<dp[i][j]<<" ";
        }
        //cout<<"\n";
    }
    cout<<ans<<"\n";
    return 0;
}


Measured memory_bytes: 14016