#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
const long long MOD = 1000000007;

template<const long long MOD>
class Modint{
    public:
        Modint() : x(0) {

        }

        Modint(long long y) : x((y % MOD + MOD) % MOD) {

        }

        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;
        }

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

        bool operator<(const Modint& p) const {
            return x < p.x;
        }

        bool operator>(const Modint& p) const {
            return x > p.x;
        }

        bool operator<=(const Modint& p) const {
            return !(*this > p);
        }

        bool operator>=(const Modint& p) const {
            return !(*this < p);
        }

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

        Modint pow(long long n) const {
            Modint ret(1), mul(x);
            while(n > 0){
                if(n & 1) ret *= mul;
                mul *= mul;
                n >>= 1;
            }
            return ret;
        }

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

        friend istream &operator>>(istream& is, Modint& a){
            long long t;
            cin >> t;
            a = Modint<MOD>(t);
            return is;
        }

        explicit operator long long() const {
            return x;
        }

        static long long get_mod(){
            return MOD;
        }

    private:
        long long x;
};

template<const long long MOD>
class Combination_Mod{
    public:
        Combination_Mod(long long N) : fact(N), inv(N), finv(N), N(N){
            init();
        }

        void init(){
            fact[0] = fact[1] = 1;
            finv[0] = finv[1] = 1;
            inv[1] = 1;
            for(long long i = 2; i < N; ++i){
                fact[i] = fact[i - 1] * i;
                inv[i] = -inv[MOD % i] * (MOD / i);
                finv[i] = finv[i - 1] * inv[i];
            }
        }

        Modint<MOD> bin(long long n, long long r){
            if(n < r || n < 0 || r < 0) return 0;
            return fact[n] * finv[r] * finv[n - r];
        }

        Modint<MOD> perm(long long n, long long r){
            return bin(n, r) * fact[r];
        }

        Modint<MOD> factorial(long long n){
            return fact[n];
        }

        Modint<MOD> inverse(long long n){
            return inv[n];
        }

        Modint<MOD> fact_inverse(long long n){
            return finv[n];
        }

    private:
        vector<Modint<MOD>> fact;
        vector<Modint<MOD>> inv;
        vector<Modint<MOD>> finv;
        const long long N;
};

using mint = Modint<MOD>;
Combination_Mod<MOD> cm(3000);

signed main(){
    ll S;
    cin >> S;
    mint ans = 0;
    FOR(i, 1, S / 3 + 1){
        ans += cm.bin(i + (S - 3 * i) - 1, S - 3 * i);
    }
    PRINT(ans);
    return 0;
}

Measured memory_bytes: 3668