#include <bits/stdc++.h>

using namespace std;

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

struct comb_cal {
    typedef long long ll;
    /*
     * ģ�����µĿ�������
     */
    const int mod = (int) 1e9 + 7;

    inline int add(int a, int b) const {
        a += b;
        return a < mod ? a : a - mod;
    }

    inline int sub(int a, int b) const {
        a -= b;
        return a < 0 ? a + mod : a;
    }

    inline int mul(ll a, int b) const {
        a *= b;
        return a < mod ? a : a - a / mod * mod;
    }

    inline int pow_mod(int a, ll b) const {
        int res = 1;
        for (; b; b >>= 1, a = mul(a, a))if (b & 1)res = mul(res, a);
        return res;
    }

    inline int inv(int a) const {
        a %= mod;
        if (a < 0) a += mod;
        int b = mod, u = 0, v = 1;
        for (; a;) {
            int t = b / a;
            b -= t * a;
            swap(a, b);
            u -= t * v;
            swap(u, v);
        }
        if (b != 1)
            return -1;
        if (u < 0) u += mod;
        return u;
    }


    /*
     * ����n!/(m!*(n-m)!),On��Ԥ�����׳˺ͽ׳˵���Ԫ֮��O1����C(n,m)
     * ʹ�ã��ʼinitһ�Σ�ͨ��ʹ��C(n,m)����
     * ģ����Ҫ��
     */
    vector<int> fact, finv;
    void init_comb_1(unsigned n = 1000000) {
        fact.resize(n + 10);
        finv.resize(n + 10);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) {
            fact[i] = mul(fact[i - 1], i);
        }
        finv[n] = inv(fact[n]);
        for (int i = n - 1; ~i; --i) {
            finv[i] = mul(finv[i + 1], (i + 1));
#ifdef LOCAL
            assert(1ll * fact[i] * finv[i] % mod == 1);
#endif
        }
    }

    inline int C(int n, int m) const {
        if (n < m) return 0;
        return (int) (((ll) fact[n] * finv[m] % mod) * finv[n - m] % mod);
    }

    /*
     * ¬��˹����
     */
    inline int lucas(int n, int m) const {
        if (n < m) return 0;
        if (!m || n == m) return 1;
        return mul(lucas(n / mod, m / mod), C(n % mod, m % mod));
    }

    /*
     * n^2Ԥ���������Ƴ�C����ģ��û��Ҫ�󣬵��õĻ�������()�������ʹ��comb(n,m)����C(n,m)
     */
    vector<vector<int>> c2;
    void init_combsqr(int n = 3000) {
        c2.assign(n+1,vector<int>(n+1,0));
        c2[0][0] = 1;
        for(int i=1;i<=n;++i) {
            c2[i][0]=c2[i][i]=1;
            for(int j=1;j<i;++j) {
                c2[i][j]=c2[i-1][j-1]+c2[i-1][j];
                if (c2[i][j] >= mod) {
                    c2[i][j] -= mod;
                }
            }
        }
    }
    int operator()(int n, int m) const {
        return n < m? 0: c2[n][m];
    }

    /*
     * ���ټ���val^k,������Ŀ���val�����Ƕ��ģ�������Ŀ��1e8��2��1e10���ڵ���
     * Ԥ������sqrt(maxn)�ģ�������O1�ģ��ǳ�����
     */
    vector<int> const_power_head, const_init_power;
    unsigned power_block = 100000;

    void gen_const_power(ll val) {
        const_power_head.resize(power_block + 2);
        const_init_power.resize(power_block + 2);
        const_init_power[0] = 1;
        for (int i = 1; i <= power_block; ++i) {
            const_init_power[i] = mul(val, const_init_power[i - 1]);
        }
        const_power_head[0] = 1;
        for (int i = 1; i <= power_block; ++i) {
            const_power_head[i] = mul(const_power_head[i - 1], const_init_power[power_block]);
        }
    }

    inline int get_const_power(ll x) { // val ^ x
        if (x >= mod - 1) {
            x %= mod - 1;// x %= euler_phi(mod);
        }
        return mul(const_power_head[x / power_block], const_init_power[x % power_block]);
    }
} comb;

const int MAXN = 2020;
int dp[MAXN];

int dfs(int x) {
  if (dp[x] != -1) {
    return dp[x];
  }
  int res = 0;
  if (x >= 3) {
    res++;
  }
  for (int i = 3; i <= x; i++) {
    res = comb.add(res, dfs(x - i));
  }
  dp[x] = res;
  return res;
}

int main() {
  ios:: sync_with_stdio(false);
  cin.tie();
  int n;
  cin >> n;
  memset(dp, -1, sizeof dp);
  cout << dfs(n);
  return 0;
}




Measured memory_bytes: 3680