//triedodin
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/assoc_container.hpp> 
using namespace std;
using namespace __gnu_pbds;
#define mem(a, b) memset(a, (b), sizeof(a))
#define all(cont) cont.begin(), cont.end()
#define pb push_back
#define PI 3.1415926535897932384626433832795
#define mod1 1000000007
#define mod2 998244353
#define ll long long int
#define ld long double 
#define inf LLONG_MAX
#define endl "\n"
#define F first
#define S second
#define inp(a) int a;cin>>a;
#define inpa(a,n)vector<int> a(n);for(int i = 0; i<n; i++)cin>>a[i];
const double pi=acos(-1.0);
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; //greater<int> can also be used
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define sz(c) (int)c.size()
#define d1(x)            cout<<#x<<"="<<x<<endl;
#define d2(x,y)          cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define d3(x,y,z)        cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define d4(x,y,z,w)      cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w <<"="<<w<<endl;
#define da(arr,j,n)  for(int i=j;i<n;i++) {cout<<"i="<<i<<" arr[i]="<<arr[i]<<"\n";} 

const  ll MODA =                         1000000007;
// const  int MODA =                     998244353 ;
vector<ll> primefactors    ;            // used by generatePrimeFactors()                                                                                   // ARRAYS/VECTORS
vector<ll> factors         ;            // used by generateFactors()

bool isPowerTwo(ll x)                   { return (x && !(x & (x - 1))); }                                                                                    // FUNCTIONS
ll   modmul(ll a,ll b)                  { return((a%MODA)*(b%MODA))%MODA;     }
ll   modadd(ll a,ll b)                  { return((a%MODA)+(b%MODA)+MODA)%MODA;}
ll   modsub(ll a,ll b)                  { return((a%MODA)-(b%MODA)+MODA)%MODA;}
bool isSubstring(string s1, string s2)  { if (s1.find(s2) != string::npos) return true; else return false; }

bool isPrime(ll n)                      { if(n<2) return false; for(ll i=2;i*i<=n;i++) if(n%i==0) return false; return true; } //O(sqrt(n))
ll   power(ll a, ll b)                  {   ll res=1; while(b) {    if(b&1) res=(res*a); a=(a*a);   b>>=1;  }   return res; }
ll   powermod(ll a, ll b)               {   ll res=1; while(b) {    if(b&1) res=(res*a)%MODA; a=(a*a)%MODA;     b>>=1;  }   return res; }
ll   modi (ll a)                        { ll m=MODA,s=1,p=0;  while(a>1)  {  ll q=a/m,t=m;  m=a%m; a=t; t=p; p=s-q*p; s=t;  } return s>=0 ? s :s+MODA; }


///////////////////////////////////
const ll Nmax = 1000005;

////////////////////////////////////
const int N = 4000; 

//Time Complexity: O(10^6) for precomputing 
//and O(1) for every query.
  
// array to store inverse of 1 to N 
ll factorialNumInverse[N + 1]; 
  
// array to precompute inverse of 1! to N! 
ll naturalNumInverse[N + 1]; 
  
// array to store factorial of first N numbers 
ll fact[N + 1]; 
    
void InverseofNumber(ll p) 
{ 
    naturalNumInverse[0] = naturalNumInverse[1] = 1; 
    for (int i = 2; i <= N; i++) 
        naturalNumInverse[i] = naturalNumInverse[p % i] * (p - p / i) % p; 
} 
// Function to precompute inverse of factorials 
void InverseofFactorial(ll p) 
{ 
    factorialNumInverse[0] = factorialNumInverse[1] = 1; 
  
    // precompute inverse of natural numbers 
    for (int i = 2; i <= N; i++) 
        factorialNumInverse[i] = (naturalNumInverse[i] * factorialNumInverse[i - 1]) % p; 
} 
  
// Function to calculate factorial of 1 to N 
void factorial(ll p) 
{ 
    fact[0] = 1; 
  
    // precompute factorials 
    for (int i = 1; i <= N; i++) { 
        fact[i] = (fact[i - 1] * i) % p; 
    } 
} 
  
// Function to return nCr % p in O(1) time 
ll Binomial(ll N, ll R, ll p) 
{ 
    // n C r = n!*inverse(r!)*inverse((n-r)!) 
    ll ans = ((fact[N] * factorialNumInverse[R]) 
              % p * factorialNumInverse[N - R]) 
             % p; 
    return ans; 
}


void solve(){

    ll n;
    cin >> n;

    ll p = 1000000007; 
    InverseofNumber(p); 
    InverseofFactorial(p); 
    factorial(p);

    ll total = 0;

    ll nob = 1;

    while(true){

        if(n/(3*nob) == 0){
            break;
        }

        ll temp = n;
        temp -= (nob*3);

        total += Binomial(temp+nob-1, nob -1, p);
          total%=mod1;   
        nob++;
    }
   
    cout << total << endl;



}

int main(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
        ios_base::sync_with_stdio(false); cin.tie(0);
     

        int t= 1;
      // cin >> t;

        while(t--){
            solve();
        }

        printclock;
    

  }

/////////////////////////////
//try to bring as much symmetry as possible
//just check for integer overflow
//add MOD value when you substract two numbers
//clear globally declared vectors after each test case 
/////////////////////////////

Measured memory_bytes: 3888