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

template<typename T>
istream& operator>>(istream& is,vector<T>& a){
    for(int i=0;i<a.size();i++)is>>a[i];
    return is;
}
template<typename T,typename U>
istream& operator>>(istream& is,pair<T,U>& p){
    is>>p.first>>p.second;
    return is;
}

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& a){
    for(int i=0;i<a.size();i++){
        os<<a[i]<<((i+1!=a.size())?" ":"");
    }
    return os;
}
template<typename T,typename U>
ostream& operator<<(ostream& os,const pair<T,U>& p){
    os<<p.first<<" "<<p.second;
    return os;
}

struct hishimochi{
    hishimochi(){
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
    }
};
hishimochi Hishimochi;

struct edge{
    long long to,cost;
    edge(long long a,long long b):to(a),cost(b){}
};
struct edge2{
    long long from,to,cost;
    edge2(long long a,long long b,long long c):from(a),to(b),cost(c){}
};

using ll=long long;
using ull=unsigned long long;
using ld=long double;
using pll=pair<long long,long long>;
using vl=vector<long long>;
using vvl=vector<vector<long long>>;
using vvvl=vector<vector<vector<long long>>>;
using vc=vector<char>;
using vvc=vector<vector<char>>;
using vs=vector<string>;
using vb=vector<bool>;
using vvb=vector<vector<bool>>;
using vp=vector<pair<long long,long long>>;
using Lqueue=priority_queue<long long>;
using Squeue=priority_queue<long long,vector<long long>,greater<long long>>;

const int MOD1=1000000007;
const int MOD2=998244353;
const long double PI=3.1415926535897932;
const long long MAXLL=9223372036854775807;
const long long INF=2305843009213693951;
const long double eps=0.0000000001;
const int dx[]={0,1,0,-1,1,-1,1,-1};
const int dy[]={1,0,-1,0,1,1,-1,-1};

#define overload2(_1,_2,name,...) name
#define overload3(_1,_2,_3,name,...) name
#define rep1(n) for(int _=0;_<(n);_++)
#define rep2(i,n) for(int i=0;i<(n);i++)
#define rep3(i,s,n) for(long long i=(s);i<(n);i++)
#define rep(...) overload3(__VA_ARGS__,rep3,rep2,rep1)(__VA_ARGS__)
#define bitrep1(n) for(int _=0;_<(1LL<<(n));_++)
#define bitrep2(i,n) for(int i=0;i<(1LL<<(n));i++)
#define bitrep3(i,s,n) for(int i=(s);i<(1LL<<(n));i++)
#define bitrep(...) overload3(__VA_ARGS__,bitrep3,bitrep2,bitrep1)(__VA_ARGS__)
#define rrep1(i,n) for(int i=n-1;i>=0;i--)
#define rrep2(i,s,n) for(long long i=n-1;i>=s;i--)
#define rrep(...) overload2(__VA_ARGS__,rrep2,rrep1)(__VA_ARGS__)

#define rbf(a,x) for(auto& a:x)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define bitcheck(bit,i) (bit)&(1LL<<(i))
#define Maxe(x) *max_element((x).begin(),(x).end())
#define Mine(x) *min_element((x).begin(),(x).end())
#define Sume(x) accumulate((x).begin(),(x).end(),0LL)
#define Size(x) ((long long)(x).size())
#define Sort(x) sort((x).begin(),(x).end())
#define rSort(x) sort((x).rbegin(),(x).rend())
#define Lin(s) getline(cin,(s))

#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define eb emplace_back

void Yes(bool a){cout<<(a?"Yes":"No")<<endl;}
void YES(bool a){cout<<(a?"YES":"NO")<<endl;}
long long Gcd(long long a,long long b){return b?Gcd(b,a%b):a;}
long long Lcm(long long a,long long b){return a/Gcd(a,b)*b;}
inline long long cutup(long long a,long long b){return (a+b-1)/b;}
inline long long popcnt(long long a){return __builtin_popcountll(a);}
template<class T,class U> auto max(T a,U b){return a>b?a:b;}
template<class T,class U> auto min(T a,U b){return a<b?a:b;}
template<class T,class U> inline bool chmin(T& a,U b){if(a>b){a=b;return true;}return false;}
template<class T,class U> inline bool chmax(T& a,U b){if(a<b){a=b;return true;}return false;}

//MODint
template<long long MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr long long getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }

    friend constexpr istream& operator >> (istream &is, Fp<MOD>& x){
        long long t;
        is >> t;
        x=t;
        return (is);
    }
};
using mint = Fp<MOD1>;

template <class T>
struct Comb{
    vector<T> fact_,fact_inv_,inv_;
    Comb(){}
    Comb(int SIZE):fact_(SIZE,1),fact_inv_(SIZE,1),inv_(SIZE,1){init(SIZE);}
    void init(int SIZE){
        fact_.assign(SIZE,1),fact_inv_.assign(SIZE,1),inv_.assign(SIZE,1);
        int MOD=fact_[0].getmod();
        for(int i=2;i<SIZE;i++){
            fact_[i]=fact_[i - 1]*i;
            inv_[i]=-inv_[MOD % i]*(MOD/i);
            fact_inv_[i]=fact_inv_[i-1]*inv_[i];
        }
    }
    T nCk(int n,int k){
        if(n<k){
            cout<<"ERROR n<k"<<endl;
            return 0;
        }
        if(n<0||k<0){
            cout<<"ERROR n<0||k<0"<<endl;
            return 0;
        }
        return fact_[n]*fact_inv_[k]*fact_inv_[n-k];
    }
    T nHk(int n,int k){
        if(n<k){
            cout<<"ERROR n<k"<<endl;
            return 0;
        }
        return nCk(n+k-1,k);
    }
    T fact(int n){
        return fact_[n];
    }
    T fact_inv(int n){
        return fact_inv_[n];
    }
    T inv(int n){
        return inv_[n];
    }
};

signed main(){
    ll s;
    cin>>s;
    mint res=0;
    Comb<mint> C(2005);
    {
        int i=1;
        while(i*3<=s){
            res+=C.nCk(s-i*2-1,i-1);
            i++;
        }
    }
    cout<<res<<endl;
}

Measured memory_bytes: 3704