#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

const long long INF=INT_MAX/4;
const long long MOD=1'000'000'007;
const double EPS=1e-14;
const bool DEBUG=true;

const string YES = "YES";
const string NO = "NO";
const string Yes = "Yes";
const string No = "No";

template<class T>
void debug(T head){
    if(DEBUG){
        cout<<head<<endl;
    }
}

template <class Head, class... Body>
void debug(Head head, Body... body){
    if(DEBUG){
        cout<<head<<" ";
        debug(body...);
    }
}

/////
template< long long mod >
class ModInt {
public:
    long long x;

    ModInt(long long xx){
        if(xx < 0){
            x = (xx + mod) % mod;
        }else{
            x = xx;
        }
    }

    ModInt(){
        ModInt(0);
    }


    ModInt &operator+=(const ModInt &p) {
        if((x += p.x) >= mod) x -= mod;
        return *this;
    }

    ModInt &operator-=(const ModInt &p) {
        if((x += mod - p.x) >= mod) x -= mod;
        return *this;
    }

    ModInt &operator*=(const ModInt &p) {
        x = x * p.x % mod;
        return *this;
    }

    ModInt &operator/=(const ModInt &p) {
        *this *= p.inverse();
        return *this;
    }

    ModInt operator-() const { return ModInt(-x); }

    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

    bool operator==(const ModInt &p) const { return x == p.x; }

    inline bool operator!=(const ModInt& p) const{
        return !(*this == p);
    }

    friend ostream &operator<<(ostream &os, const ModInt &p) {
        return os << p.x;
    }

    friend istream &operator>>(istream &is, ModInt &p) {
        long long t;
        is >> t;
        p = ModInt(t);
        return (is);
    }

    ModInt inverse() const {
        long long a = x, b = mod, u = 1, v = 0, t;
        while(b > 0) {
            t = a / b;
            swap(a -= t * b, b);
            swap(u -= t * v, v);
        }
        return ModInt(u);
    }

    ModInt pow(long long n) const {
        bool negative = false;
        if(n < 0){
            negative = true;
            n = abs(n);
        }

        ModInt ret(1), mul(x);
        while(n > 0) {
            if(n & 1) ret *= mul;
            mul *= mul;
            n >>= 1;
        }

        if(negative == true){
            return ret.inverse();
        }
        return ret;
    }
};

unsigned long long int factorial(int n){
	unsigned long long int a=1;
	for(int i=1; i<=n; i++){
		a*=i;
        a%=MOD;
	}
	return a;
}

void answer(){
    unsigned long long S;
    cin>>S;

    ModInt<MOD> answer(0);
    for(int i=1; i<=S/3; ++i){
        unsigned long long sum = S - 3 * i;
        ModInt<MOD> A(factorial(sum + i - 1));
        ModInt<MOD> B(factorial(sum));
        ModInt<MOD> C(factorial(i - 1));
        // cout<<A<<endl;
        // cout<<B<<endl;
        // cout<<C<<endl;
        answer = answer + A/(B*C);
        // cout<<answer<<endl;
    }

    cout<<answer<<endl;
    return;
}

/////

int main(int argc, char* argv[]){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout.precision(16);

    answer();

    return 0;
}


Measured memory_bytes: 3608