#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vl2;
const bool multiple_queries = false;
#define rep(i, n) for(ll i = 0; i < (n) ; ++i)
#define For(i, a, b) for(ll i = (a); i < (b) ; ++i)
#define revrep(i, n) for(ll i = (n) - 1; i >= 0 ; --i)
#define revFor(i, b, a) for(ll i = (b) - 1; i >= (a) ; --i)
#define all(v) v.begin(), v.end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcount(i) __builtin_popcountl((i))
#define substring(s, start, end) s.substr((start), (end) - (start) + 1)

void print(){cout;}
void println(){cout << endl;}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail) != 0) cout << " ";
    print(forward<Tail>(tail)...);
}

template <class Head, class... Tail>
void println(Head&& head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail) != 0) cout << " ";
    println(forward<Tail>(tail)...);
}

const ll MOD = 1000000007;
// const ll MOD = 998244353;

struct mint {
    ll x;
    mint(ll x = 0): x((x % MOD + MOD) % MOD){}
    mint operator-() const {return mint(-x);}

    mint& operator+=(const mint a){
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }

    mint& operator-=(const mint a){
        if ((x += MOD - a.x) >= MOD) x -= MOD;
        return *this;
    }

mint& operator*=(const mint a) {(x *= a.x) %= MOD; return *this;}
mint operator+(const mint a) const {return mint(*this) += a;}
mint operator-(const mint a) const {return mint(*this) -= a;}
mint operator*(const mint a) const {return mint(*this) *= a;}

    mint pow(ll t) const{
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
mint inv() const {return pow(MOD - 2);}
    mint& operator/=(const mint a) {return *this *= a.inv();}
    mint operator/(const mint a) const {return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) {return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) {return os << a.x;}
string to_string(mint a){return to_string(a.x);}
typedef std::vector<mint> vmi;
typedef std::vector<vmi> vmi2;
typedef std::vector<vmi2> vmi3;
typedef std::vector<vmi3> vmi4;

struct CombinationMemo{
    ll sz, mod;
    vl fact, fact_inv, minv;

    CombinationMemo(ll sz, ll _mod):
        sz(sz), mod(_mod){
            fact.resize(sz + 5);
            fact_inv.resize(sz + 5);
            minv.resize(sz + 5);
            init();
        }

    void init(){
        fact[0] = fact[1] = 1;
        minv[1] = 1;
        fact_inv[0] = fact_inv[1] = 1;

        For(i, 2, sz + 3){
            fact[i] = (i * fact[i - 1]) % mod;
            minv[i] = mod - minv[mod % i] * (mod / i) % mod;
            fact_inv[i] = fact_inv[i - 1] * minv[i] % mod;
        }
    }

    ll nCk(ll n, ll r){
        if (n == r && n == 0) return 1;
        else if (n <= 0 || r < 0 || r > n) return 0;
        ll val = (fact[n] * fact_inv[n - r]) % mod;
        val *= fact_inv[r];
        return val % mod;
    }

    ll nPk(ll n, ll r){
        if (n == r && n == 0) return 1;
        else if (n <= 0 || r < 0 || r > n) return 0;
        ll val = (fact[n] * fact_inv[n - r]) % mod;
        return val % mod;
    }
};

void solve(){
    ll s; mint ans = 0;
    cin >> s;
    CombinationMemo comb(s + 4, MOD);

    rep(i, s / 3){
        ll res = s - 3 * (i + 1);
        ans += comb.nCk(res + i, i);
    }

    println(ans);
}

void test(ll num = 0, bool verbose = false){
    rep(i, max(1LL, num)){
        ll t = clock();
        if (verbose) cout << "\n#####" << " " << i + 1 << " " << "#####" << " " << "\n## Answer ##\n";
        solve();
        if (verbose) {cout << "\nElapsed Time:" << " " << 1000.0 * (clock() - t) / CLOCKS_PER_SEC << " " << "[ms]" << endl;}
    }
}

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    #ifdef _LOCAL
        test(6, true);
    #else
        ll t = 0;
        if (multiple_queries) cin >> t;
        test(t, false);
    #endif
    return 0;
}

Measured memory_bytes: 3676