// Original C++ solution (slower):
#include<bits/stdc++.h>

#define ll long long

#define pii pair<ll,ll>

#define debug(a) cout<<a<<'\n'

#define maxn 300009 /// I wanna be the wind

#define MOD 1000000007

#define F first

#define S second

#define rep(i, a, b) for(ll i = a; i < (b); ++i)

#define per(i, b, a) for(ll i = b-1; i>=a ; i--)

#define trav(a, x) for(auto& a : x)

#define allin(a , x) for(auto a : x)

#define all(x) begin(x), end(x)

#define sz(x) (ll)(x).size()

using namespace std;

const ll INF = 1e14 + 9;

ll mult(ll a,ll b){

    return a*b%MOD;

}

ll fastpow(ll a, ll b){

    ll calc=1;

    for(;b>=1LL;b/=2LL){

        if((b&1LL))calc=mult(calc,a);

        a=mult(a,a);

    }

    return calc;

}

ll soma(ll a,ll b){

    if(a+b>MOD)return a+b-MOD;

    else return a+b;

}

ll subt(ll a,ll b){

    if(a-b<0)return a-b+MOD;

    else return a-b;

}

ll dp[2002][2002];

int main(){

    ios::sync_with_stdio(false);

    cin.tie(0);

    ll n;

    cin>>n;

    dp[0][0]=1;

    rep(i,1,2000){

        vector<ll> prefix_dp(n+2,0);

        prefix_dp[0] = dp[i-1][0];

        rep(sum,1,n+1){

            prefix_dp[sum] = soma(dp[i-1][sum] , prefix_dp[sum-1]);

        }

        rep(sum,3*i,n+1){

            dp[i][sum] = soma(dp[i][sum],prefix_dp[sum-3]); 

        }

    }

    ll ans=0;

    rep(i,1,2000){

        ans = soma(ans,dp[i][n]);

    }

    cout<<ans<<"\n";

    return 0;  

}   

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define ld long double

#define endl "\n"

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define pb(x) push_back(x)

#define mp(a,b) make_pair(a,b)

#define ms(v,x) memset(v,x,sizeof(v))

#define all(v) v.begin(),v.end()

#define ff first

#define ss second

#define rep(i, a, b) for(int i = a; i < (b); ++i)

#define per(i, a, b) for(int i = b-1; i>=a ; i--)

#define trav(a, x) for(auto& a : x)

#define allin(a , x) for(auto a : x)

#define Unique(v) sort(all(v));v.erase(unique(all(v)),v.end());

#define sz(v) (int)v.size()

#define int long long

using namespace std;

typedef vector<int> vi;

#define y1 abacaba

#define left sefude

#define db(x) cerr << #x <<" == "<<x << endl;

#define db2(x,y) cerr<<#x <<" == "<<x<<", "<<#y<<" == "<<y<<endl;

#define db3(x,y,z) cerr << #x<<" == "<<x<<", "<<#y<<" == "<<y<<", "<<#z<<" == "<<z<<endl; 

#define prl cerr<<"called: "<< __LINE__ << endl;

typedef long long ll;

typedef pair<int,int> pii;

typedef pair<ll,ll> pll;

inline ll mod(ll n, ll m ){ ll ret = n%m; if(ret < 0) ret += m; return ret; }

ll gcd(ll a, ll b){return (b == 0LL ? a : gcd(b, a%b));}

ll exp(ll a,ll b,ll m){

    if(b==0LL) return 1LL;

    if(b==1LL) return mod(a,m);

    ll k = mod(exp(a,b/2,m),m);

    if(b&1LL){

        return mod(a*mod(k*k,m),m);

    }

    else return mod(k*k,m);

}



const int N = 2020;

const int M = 1e9 + 7;

// long long?



ll fat[N],inv[N];

ll C(int n,int k){

  if(k>n)return 0;

  return mod(fat[n]*mod(inv[k]*inv[n-k],M),M);

}



void init(){

  fat[0] = inv[0] = 1;

  for(int i=1;i<N;i++){

    fat[i] = (1LL*fat[i-1]*i)%M;

  }

  inv[N-1] = exp(fat[N-1],M-2,M);

  for(int i=N-2;i>=0;i--){

    inv[i] = (inv[i+1]*(i+1))%M;

  }

}

int32_t main(){

  fastio;

  init();

  int S;

  cin >> S;

  ll cur=0;

  for(int k=1;k<=S;k++){

    int tem = k*3;

    if(tem > S)break;

    int need = S - tem;

    cur = mod(cur + C(need + k - 1, k-1),M);

  }

  cout << cur << endl;

  // math -> gcd it all

  // Did u check N=1? Did you switch N,M?

}

// Fastest known solution for this problem: