// D - Redistribution
#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(int)(s);i<(int)(e);++i)

int main(){
	int S; cin>>S;
	int MOD = 1e9 + 7;
	vector<int64_t> C(S+1, 0);
	C[0] = 1;
	rp(n, 3, S+1) // n:[3,S]
		rp(i, 3, n+1){ // i:[3,n]
			C[n] += C[n-i];
			C[n] %= MOD;
		}
	cout<< C[S] <<endl;
}
