n = int(input())
S = n//3

def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * pow(i+1, mod-2, mod) % mod
    return res

ans = 0
if S>=1:
  for i in range(1,S+1):
    t = n - 3*i
    ans += combination(t+i-1,i-1)
  print(ans)

else:
  print(0)


import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);

		// 入力
		int s = sc.nextInt();
		int MOD = 1000000007;

		// 計算
		long result = 1;
		long[] list = new long[2001];
		list[3] = 1;
		list[4] = 1;
		list[5] = 1;
		long[] sum = new long[2001];
		sum[3] = 1;
		sum[4] = 2;
		sum[5] = 3;
		for(int i = 6; i <= s; i++){
		   list[i] = sum[i-3] + 1;
		   list[i] %= MOD;
		   sum[i] = sum[i-1] + list[i];
		   sum[i] %= MOD;
		}

		result = list[s];

		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}

}


import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        long mod = (long)1e9+7;
        Combination comb = new Combination(10000);
        int s = sc.nextInt();
        long ans = 0;
        int max = s/3;
        for(int i = 1; i <= max; i++){
            int rem = s-3*i;
            long tmp = Combination.comb(rem+i-1,rem);
            ans += tmp;
            ans %= mod;
        }
        pw.println(ans);
        pw.flush();
    }

    static class GeekInteger {
        public static void save_sort(int[] array) {
            shuffle(array);
            Arrays.sort(array);
        }

        public static int[] shuffle(int[] array) {
            int n = array.length;
            Random random = new Random();
            for (int i = 0, j; i < n; i++) {
                j = i + random.nextInt(n - i);
                int randomElement = array[j];
                array[j] = array[i];
                array[i] = randomElement;
            }
            return array;
        }
    }

}

class Combination {
    final static long mod = (long)Math.pow(10,9)+ 7;
    private static long[] fact, ifact;
    public Combination(int n){
        fact = new long[n+1];
        ifact = new long[n+1];
        fact[0] = 1;
        long ln = n;
        for (long i = 1; i <= ln; ++i){
            int ii = (int)i;
            fact[ii] = fact[ii-1]%mod * i % mod;
        }
        ifact[n] = pow(fact[n],this.mod-2);
        for (int i = n; i >= 1; --i){
            int ii = (int)i;
            ifact[ii-1] = ifact[ii]%mod*i%mod;
        }
    }

    public static long comb(int n, int k){
        if (k < 0 || k > n) return 0;
        return fact[n] % mod * ifact[k] % mod * ifact[n-k] % mod;
    }

    public static long perm(int n, int k){
        return comb(n,k) * fact[k] % mod;
    }

    public static long pow(long a,long b) {
        long ret = 1;
        long tmp = a;
        while(b>0) {
            if((b&1)==1){
                ret = (ret * tmp) % mod;
            }
            tmp = (tmp * tmp) % mod;
            b = b>>1;
        }
        return ret;
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
    }

    public String[] nextArray(int n) {
        String[] a = new String[n];
        for (int i = 0; i < n; i++)
            a[i] = next();
        return a;
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    }
}


import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) throws Exception{
		long num = 1000000007;
		long[] fact = new long[2001];
 		fact[0] = 1;
 		long ans1 = 1;
 		for(int i = 1;i<=2000;i++){
 			ans1= (ans1*i) % num;
 			fact[i] = ans1;
 		}
 		long[] inv = new long[2001];
 		inv[0] = 1;
 		for(int i = 1;i<=2000;i++){
 			inv[i] = power(fact[i], num-2, num)%num;
 		}
		// TODO Auto-generated method stub
 		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
 		PrintWriter out = new PrintWriter(System.out);
 		int s = Integer.parseInt(bf.readLine());
 		long sum = 0;
 		if (s >= 3)
 			sum = 1;
 		int count = 1;
 		for(int j = 5;j<=s;j+=2){
 			if (s-j >= count){
 				long prod = 1;
 				prod*=fact[s-j];
 				prod%=num;
 				prod*=inv[count];
 				prod%=num;
 				prod*=inv[s-j-count];
 				prod%=num;
 				sum+=prod;
 				sum%=num;
 			}
 			count++;
 		}

 		out.println(sum);

 		out.close();

 	}
	public static int power(long x, long y, long mod){
		long ans = 1;
		while(y>0){
			if (y%2==1)
				ans = (ans*x)%mod;
			x = (x*x)%mod;
			y/=2;
		}
		return (int)(ans);
	}
}

//StringJoiner sj = new StringJoiner(" ");
//sj.add(strings)
//sj.toString() gives string of those stuff w spaces or whatever that sequence is


import java.util.*;
public class Main {
    public static long mod(long x, long y){
    return x%y<0?x%y+(y<0?-y:y):x%y;
    }
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		long [] in = new long [a+1];
        in[0]=1;
		long b = 1000000007;

        for(int i=3;i<=a;i++){
          for(int j=0;j<=i-3;j++){in[i]+=in[j];
                                                     in[i]=mod(in[i],b)
                                 }
                             }
		System.out.println(in[a]);
	}
}


import java.util.*;

/**
 * D Main
 *
 * @date 2020.09.19
 * @author 焼き鮭 <yaki-shake@up-tri.me>
 */

public class Main {
  Scanner sc;
  int MIN = 3;
  int MOD = 1000000007;

  long[] dist = new long[2000];

  public static void main(String[] args) {
    new Main().execute();
  }

  public void execute() {
    this.sc = new Scanner(System.in);
    int s = this.sc.nextInt();
    if (s <= 2) {
      System.out.println(0);
      return;
    }
    System.out.println(distribute(s));
  }

  public long distribute(int a) {
    long sum = 1;
    if (dist[a] != 0) {
      return dist[a];
    }
    for (int c = MIN; c <= (a - MIN); c++) {
      sum = (sum + distribute(c)) % MOD;
    }
    dist[a] = sum;

    return sum;
  }
}


//package Test;

import java.util.*;

public class Main {

    static class Solution {

        void solve(int s){
            int mod = 1000000007;
            int[] dp = new int[s + 1];
            dp[3] = 1;
            for(int i = 4; i <= s; i++) {
                for(int j = 3; j <= i - 3; j++) {
                    dp[i] = (dp[i] + dp[j]) % mod;
                }
                dp[i] = (dp[i] + 1) % mod;
            }
            System.out.println(dp[s]);
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        Solution solution = new Solution();
        solution.solve(s);

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll              long long int
#define ull             unsigned long long int
#define mod             1000000007
#define pb              push_back
#define mp              make_pair
#define count_1(n)      __builtin_popcountll(n) //set bits
#define fr              first
#define sc              second

bool isPrime(ll n) {

  if (n == 1) {
    return false;
  }

  for (ll i = 2; i*i <=n; i++) {
    if (n % i == 0) return false;
  }

  return true;
}

ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;

    if (x == 0) return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int binarySearch(int arr[], int l, int r, int x)
{
    if (r >= l) {
        int mid = l + (r - l) / 2;

        if (arr[mid] == x)
            return mid;

        if (arr[mid] > x)
            return binarySearch(arr, l, mid - 1, x);

        return binarySearch(arr, mid + 1, r, x);
    }

    return -1;
}

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll n,sum=0;
    cin>>n;
    ll dp[n+1];
    dp[0]=1;
    dp[1]=0;
    dp[2]=0;
    for(int i=3;i<=n;i++){
        sum+=dp[i-3];
        sum%=mod;
        dp[i]=sum;
    }
    cout<<dp[n];
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll dp[1000000+5];
ll arr[1000000+5];
/*arr[0]=1;
dp[0]=1;*/
int main()
{
    /*ll n,x=1,i;
    cin>>n;
    ll mod=1000000007;
    ll dp[n+2]
    for(i=1;i<=n-1;i++)
    {
        x=x*2;
        x=x%mod;
    }
    x=x+n-1;
    x=x%mod;
    cout<<x;*/
    /*ll n;
    cin>>n;
    ll a[n],i;
    for(i=0;i<n;i++)
    {
        cin>>n;
    }*/
    ll n,i;
    cin>>n;
    ll mod=1000000007;
    ll dp[n+10];
    dp[0]=dp[1]=dp[2]=0;
    dp[3]=dp[4]=dp[5]=1;
    for(i=6;i<=n;i++)
    {
        dp[i]=(dp[i-1]+dp[i-3])%mod;
    }
    cout<<dp[n];
}


#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable: 4244) // 最悪をします
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <numeric>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <string>
#include <functional>
#include <list>
#include <random>
#include <time.h>
#include <iomanip>
#include <assert.h>
#include <numeric>
#include <sstream>
#define BIT(nr) (1UL << (nr))
//#define int long long
//#define ll long long
#define double long double
#define mod 1000000007
#define MAXN (int)1e+5 * 2+1
#define LL_MAX 9223372036854775807	//ない環境用
#define LL_HALFMAX 9223372036854775807 / 2	//ない環境用
#define MIN -(9223372036854775807 / 2)
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define mp make_pair
template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }

using namespace std;

signed ans[] = { 0, 0, 1, 1, 1, 2, 3, 4, 6, 9, 13, 19, 28, 41, 60, 88, 129, 189, 277, 406, 595, 872, 1278, 1873, 2745, 4023, 5896, 8641, 12664, 18560, 27201, 39865, 58425, 85626, 125491, 183916, 269542, 395033, 578949, 848491, 1243524, 1822473, 2670964, 3914488, 5736961, 8407925, 12322413, 18059374, 26467299, 38789712, 56849086, 83316385, 122106097, 178955183, 262271568, 384377665, 563332848, 825604416, 209982074, 773314922, 598919331, 808901405, 582216320, 181135644, 990037049, 572253362, 753389006, 743426048, 315679403, 69068402, 812494450, 128173846, 197242248, 9736691, 137910537, 335152785, 344889476, 482800013, 817952798, 162842267, 645642280, 463595071, 626437338, 272079611, 735674682, 362112013, 634191624, 369866299, 731978312, 366169929, 736036228, 468014533, 834184462, 570220683, 38235209, 872419671, 442640347, 480875556, 353295220, 795935567, 276811116, 630106336, 426041896, 702853012, 332959341, 759001237, 461854242, 794813583, 553814813, 15669048, 810482631, 364297437, 379966485, 190449109, 554746546, 934713031, 125162133, 679908679, 614621703, 739783836, 419692508, 34314204, 774098040, 193790541, 228104745, 2202778, 195993319, 424098064, 426300842, 622294161, 46392218, 472693060, 94987214, 141379432, 614072492, 709059706, 850439138, 464511623, 173571322, 24010453, 488522076, 662093398, 686103851, 174625920, 836719318, 522823162, 697449082, 534168393, 56991548, 754440630, 288609016, 345600564, 100041187, 388650203, 734250767, 834291954, 222942150, 957192917, 791484864, 14427007, 971619924, 763104781, 777531788, 749151705, 512256479, 289788260, 38939958, 551196437, 840984697, 879924655, 431121085, 272105775, 152030423, 583151508, 855257283, 7287699, 590439207, 445696483, 452984182, 43423382, 489119865, 942104047, 985527429, 474647287, 416751327, 402278749, 876926036, 293677356, 695956105, 572882134, 866559490, 562515588, 135397715, 1957198, 564472786, 699870501, 701827699, 266300478, 966170979, 667998671, 934299149, 900470121, 568468785, 502767927, 403238041, 971706826, 474474746, 877712787, 849419606, 323894345, 201607125, 51026724, 374921069, 576528194, 627554918, 2475980, 579004174, 206559085, 209035065, 788039239, 994598324, 203633382, 991672621, 986270938, 189904313, 181576927, 167847858, 357752171, 539329098, 707176956, 64929120, 604258218, 311435167, 376364287, 980622505, 292057665, 668421952, 649044450, 941102115, 609524060, 258568503, 199670611, 809194671, 67763167, 267433778, 76628442, 144391609, 411825387, 488453829, 632845438, 44670818, 533124647, 165970078, 210640896, 743765543, 909735621, 120376510, 864142053, 773877667, 894254177, 758396223, 532273883, 426528053, 184924269, 717198152, 143726198, 328650467, 45848612, 189574810, 518225277, 564073889, 753648699, 271873969, 835947858, 589596550, 861470519, 697418370, 287014913, 148485425, 845903795, 132918701, 281404126, 127307914, 260226615, 541630741, 668938655, 929165270, 470796004, 139734652, 68899915, 539695919, 679430571, 748330486, 288026398, 967456969, 715787448, 3813839, 971270808, 687058249, 690872088, 662142889, 349201131, 40073212, 702216101, 51417225, 91490437, 793706538, 845123763, 936614200, 730320731, 575444487, 512058680, 242379404, 817823891, 329882564, 572261968, 390085852, 719968416, 292230377, 682316229, 402284638, 694515015, 376831237, 779115875, 473630883, 850462120, 629577988, 103208864, 953670984, 583248965, 686457829, 640128806, 223377764, 909835593, 549964392, 773342156, 683177742, 233142127, 6484276, 689662018, 922804145, 929288421, 618950432, 541754570, 471042984, 89993409, 631747979, 102790956, 192784365, 824532344, 927323300, 120107658, 944640002, 871963295, 992070953, 936710948, 808674236, 800745182, 737456123, 546130352, 346875527, 84331643, 630461995, 977337522, 61669158, 692131153, 669468668, 731137826, 423268972, 92737633, 823875459, 247144424, 339882057, 163757509, 410901933, 750783990, 914541499, 325443425, 76227408, 990768907, 316212325, 392439733, 383208633, 699420958, 91860684, 475069317, 174490268, 266350952, 741420269, 915910537, 182261482, 923681751, 839592281, 21853756, 945535507, 785127781, 806981537, 752517037, 537644811, 344626341, 97143371, 634788182, 979414523, 76557887, 711346069, 690760585, 767318472, 478664534, 169425112, 936743584, 415408111, 584833223, 521576800, 936984911, 521818127, 43394920, 980379831, 502197951, 545592871, 525972695, 28170639, 573763510, 99736198, 127906837, 701670347, 801406545, 929313382, 630983722, 432390260, 361703635, 992687357, 425077610, 786781245, 779468595, 204546198, 991327443, 770796031, 975342229, 966669665, 737465689, 712807911, 679477569, 416943251, 129751155, 809228724, 226171968, 355923123, 165151840, 391323808, 747246931, 912398771, 303722572, 50969496, 963368267, 267090832, 318060328, 281428588, 548519420, 866579748, 148008329, 696527749, 563107490, 711115819, 407643561, 970751051, 681866863, 89510417, 60261461, 742128324, 831638741, 891900202, 634028519, 465667253, 357567448, 991595967, 457263213, 814830661, 806426621, 263689827, 78520481, 884947102, 148636922, 227157403, 112104498, 260741420, 487898823, 600003321, 860744741, 348643557, 948646878, 809391612, 158035162, 106682033, 916073645, 74108800, 180790833, 96864471, 170973271, 351764104, 448628575, 619601846, 971365950, 419994518, 39596357, 10962300, 430956818, 470553175, 481515475, 912472293, 383025461, 864540936, 777013222, 160038676, 24579605, 801592827, 961631503, 986211108, 787803928, 749435424, 735646525, 523450446, 272885863, 8532381, 531982827, 804868690, 813401071, 345383891, 150252574, 963653645, 309037529, 459290103, 422943741, 731981270, 191271366, 614215107, 346196370, 537467736, 151682836, 497879206, 35346935, 187029771, 684908977, 720255912, 907285683, 592194653, 312450558, 219736234, 811930887, 124381438, 344117672, 156048552, 280429990, 624547662, 780596214, 61026197, 685573859, 466170066, 527196263, 212770115, 678940181, 206136437, 418906552, 97846726, 303983163, 722889715, 820736441, 124719597, 847609312, 668345746, 793065343, 640674648, 309020387, 102085723, 742760371, 51780751, 153866474, 896626845, 948407596, 102274063, 998900908, 947308497, 49582553, 48483454, 995791951, 45374497, 93857951, 89649895, 135024392, 228882343, 318532238, 453556630, 682438973, 971204, 454527834, 136966800, 137938004, 592465838, 729432638, 867370642, 459836473, 189269104, 56639739, 516476212, 705745316, 762385055, 278861260, 984606576, 746991624, 25852877, 10459446, 757451070, 783303947, 793763393, 551214456, 334518396, 128281782, 679496238, 14014627, 142296409, 821792647, 835807274, 978103683, 799896323, 635703590, 613807266, 413703582, 49407165, 663214431, 76918006, 126325171, 789539602, 866457608, 992782779, 782322374, 648779975, 641562747, 423885114, 72665082, 714227829, 138112936, 210778018, 925005847, 63118776, 273896794, 198902634, 262021410, 535918204, 734820838, 996842248, 532760445, 267581276, 264423517, 797183962, 64765231, 329188748, 126372703, 191137934, 520326682, 646699385, 837837319, 358163994, 4863372, 842700691, 200864678, 205728050, 48428734, 249293412, 455021462, 503450196, 752743608, 207765063, 711215259, 463958860, 671723923, 382939175, 846898035, 518621951, 901561126, 748459154, 267081098, 168642217, 917101371, 184182462, 352824679, 269926043, 454108505, 806933184, 76859220, 530967725, 337900902, 414760122, 945727847, 283628742, 698388864, 644116704, 927745446, 626134303, 270251000, 197996439, 824130742, 94381735, 292378174, 116508909, 210890644, 503268818, 619777727, 830668371, 333937182, 953714909, 784383273, 118320448, 72035350, 856418623, 974739071, 46774414, 903193037, 877932101, 924706515, 827899545, 705831639, 630538147, 458437685, 164269317, 794807464, 253245142, 417514459, 212321916, 465567058, 883081517, 95403426, 560970484, 444051994, 539455420, 100425897, 544477891, 83933304, 184359201, 728837092, 812770396, 997129597, 725966682, 538737071, 535866661, 261833336, 800570407, 336437061, 598270397, 398840797, 735277858, 333548248, 732389045, 467666896, 801215144, 533604182, 1271071, 802486215, 336090390, 337361461, 139847669, 475938059, 813299520, 953147189, 429085241, 242384754, 195531936, 624617177, 867001931, 62533860, 687151037, 554152961, 616686821, 303837851, 857990812, 474677626, 778515477, 636506282, 111183901, 889699378, 526205653, 637389554, 527088925, 53294571, 690684125, 217773043, 271067614, 961751739, 179524775, 450592389, 412344121, 591868896, 42461278, 454805399, 46674288, 89135566, 543940965, 590615253, 679750819, 223691777, 814307030, 494057842, 717749619, 532056642, 26114477, 743864096, 275920731, 302035208, 45899297, 321820028, 623855236, 669754533, 991574561, 615429790, 285184316, 276758870, 892188660, 177372969, 454131839, 346320492, 523693461, 977825300, 324145785, 847839246, 825664539, 149810317, 997649563, 823314095, 973124412, 970773968, 794088056, 767212461, 737986422, 532074471, 299286925, 37273340, 569347811, 868634736, 905908076, 475255880, 343890609, 249798678, 725054558, 68945160, 318743838, 43798389, 112743549, 431487387, 475285776, 588029325, 19516705, 494802481, 82831799, 102348504, 597150985, 679982784, 782331288, 379482266, 59465043, 841796331, 221278590, 280743633, 122539957, 343818547, 624562180, 747102137, 90920677, 715482857, 462584987, 553505664, 268988514, 731573501, 285079158, 554067672, 285641166, 570720324, 124787989, 410429155, 981149479, 105937461, 516366616, 497516088, 603453549, 119820158, 617336246, 220789788, 340609946, 957946192, 178735973, 519345919, 477292104, 656028077, 175373989, 652666093, 308694163, 484068152, 136734238, 445428401, 929496553, 66230784, 511659185, 441155731, 507386515, 19045693, 460201424, 967587939, 986633632, 446835049, 414422981, 401056606, 847891655, 262314629, 663371235, 511262883, 773577512, 436948740, 948211623, 721789128, 158737861, 106949477, 828738605, 987476466, 94425936, 923164541, 910641000, 5066929, 928231470, 838872463, 843939392, 772170855, 611043311, 454982696, 227153544, 838196855, 293179544, 520333088, 358529936, 651709480, 172042561, 530572497, 182281970, 354324531, 884897028, 67178991, 421503522, 306400543, 373579534, 795083056, 101483592, 475063126, 270146175, 371629767, 846692893, 116839061, 488468828, 335161714, 452000775, 940469603, 275631310, 727632085, 668101681, 943732991, 671365069, 339466743, 283199727, 954564796, 294031532, 577231259, 531796048, 825827580, 403058832, 934854880, 760682453, 163741278, 98596151, 859278604, 23019875, 121616026, 980894630, 3914498, 125530524, 106425147, 110339645, 235870169, 342295316, 452634961, 688505130, 30800439, 483435400, 171940523, 202740962, 686176362, 858116885, 60857840, 747034202, 605151080, 666008920, 413043115, 18194188, 684203108, 97246216, 115440404, 799643512, 896889728, 12330125, 811973637, 708863358, 721193483, 533167113, 242030464, 963223947, 496391053, 738421517, 701645457, 198036503, 936458020, 638103470, 836139973, 772597986, 410701449, 246841415, 19439394, 430140843, 676982258, 696421652, 126562488, 803544746, 499966391, 626528879, 430073618, 930040009, 556568881, 986642499, 916682501, 473251375, 459893867, 376576361, 849827736, 309721596, 686297957, 536125686, 845847282, 532145232, 68270911, 914118193, 446263418, 514534329, 428652515, 874915933, 389450255, 818102770, 693018696, 82468944, 900571714, 593590403, 676059347, 576631054, 170221450, 846280797, 422911844, 593133294, 439414084, 862325928, 455459215, 894873299, 757199220, 212658428, 107531720, 864730940, 77389361, 184921081, 49652014, 127041375, 311962456, 361614470, 488655845, 800618301, 162232764, 650888609, 451506903, 613739667, 264628269, 716135172, 329874832, 594503101, 310638266, 640513098, 235016192, 545654458, 186167549, 421183741, 966838199, 153005741, 574189482, 541027674, 694033415, 268222890, 809250564, 503283972, 771506862, 580757419, 84041384, 855548246, 436305658, 520347042, 375895281, 812200939, 332547974, 708443255, 520644187, 853192161, 561635409, 82279589, 935471750, 497107152, 579386741, 514858484, 11965629, 591352370, 106210847, 118176476, 709528846, 815739693, 933916169, 643445008, 459184694, 393100856, 36545857, 495730551, 888831407, 925377264, 421107808, 309939208, 235316465, 656424273, 966363481, 201679939, 858104212, 824467686, 26147618, 884251830, 708719509, 734867127, 619118950, 327838452, 62705572, 681824522, 9662967, 72368539, 754193061, 763856028, 836224567, 590417621, 354273642, 190498202, 780915823, 135189458, 325687660, 106603476, 241792934, 567480594, 674084070, 915877004, 483357591, 157441654, 73318651, 556676242, 714117896, 787436547, 344112782, 58230671, 845667218, 189779993, 248010664, 93677875, 283457868, 531468532, 625146407, 908604275, 440072800, 65219200, 973823475, 413896268, 479115468, 452938936, 866835204, 345950665, 798889601, 665724798, 11675456, 810565057, 476289848, 487965304, 298530354, 774820202, 262785499, 561315853, 336136048, 598921547, 160237393, 496373441, 95294981, 255532374, 751905815, 847200796, 102733163, 854638978, 701839767, 804572930, 659211901, 361051661, 165624584, 824836485, 185888139, 351512723, 176349201, 362237340, 713750063, 890099264, 252336597, 966086660, 856185917, 108522507, 74609160, 930795077, 39317577, 113926737, 44721807, 84039384, 197966121, 242687928, 326727312, 524693433, 767381361, 94108666, 618802099, 386183453, 480292119, 99094211, 485277664, 965569783, 64663987, 549941651, 515511427, 580175414, 130117058, 645628485, 225803892, 355920950, 1549428, 227353320, 583274270, 584823698, 812177018, 395451281, 980274979, 792451990, 187903264, 168178236, 960630226, 148533483, 316711719, 277341938, 425875421, 742587140, 19929071, 445804492, 188391625, 208320696, 654125188, 842516813, 50837502, 704962690, 547479496, 598316998, 303279681, 850759177, 449076168, 752355849, 603115019, 52191180, 804547029, 407662041, 459853221, 264400243, 672062284, 131915498, 396315741, 68378018, 200293516, 596609257, 664987275, 865280791, 461890041, 126877309, 992158100, 454048134, 580925443, 573083536, 27131663, 608057106, 181140635, 208272298, 816329404, 997470039, 205742330, 22071727, 19541759, 225284089, 247355816, 266897575, 492181664, 739537480, 6435048, 498616712, 238154185, 244589233, 743205945, 981360130, 225949356, 969155301, 950515424, 176464773, 145620067, 96135484, 272600257, 418220324, 514355808, 786956065, 205176382, 719532190, 506488248, 711664630, 431196813, 937685061, 649349684, 80546490, 18231544, 667581228, 748127718, 766359262, 433940483, 182068194, 948427456, 382367932, 564436126, 512863575, 895231507, 459667626, 972531201, 867762701, 327430320, 299961514, 167724208, 495154528, 795116042, 962840250, 457994771, 253110806, 215951049, 673945820, 927056626, 143007668, 816953488, 744010107, 887017775, 703971256, 447981356, 334999124, 38970373, 486951729, 821950853, 860921226, 347872948, 169823794, 30745013, 378617961, 548441755, 579186768, 957804729, 506246477, 85433238, 43237960, 549484437, 634917675, 678155635, 227640065, 862557740, 540713368, 768353433, 630911166, 171624527, 939977960, 570889119, 742513646, 682491599, 253380711, 995894357, 678385949, 931766660, 927661010, 606046952, 537813605, 465474608, 71521553, 609335158, 74809759, 146331312, 755666470, 830476229, 976807541, 732474004, 562950226, 539757760, 272231757, 835181983, 374939736, 647171493, 482353469, 857293205, 504464691, 986818160, 844111358, 348576042, 335394195, 179505546, 528081588, 863475783, 42981322, 571062910, 434538686, 477520008, 48582911, 483121597, 960641605, 9224509, 492346106, 452987704, 462212213, 954558319, 407546016, 869758229, 824316541, 231862550, 101620772, 925937313, 157799856, 259420628, 185357934, 343157790, 602578418, 787936352, 131094135, 733672553, 521608898, 652703033, 386375579, 907984477, 560687503, 947063082, 855047552, 415735048, 362798123, 217845668, 633580716, 996378839, 214224500, 847805216, 844184048, 58408541, 906213757, 750397798, 808806339, 715020089, 465417880, 274224212, 989244301, 454662174, 728886386, 718130680, 172792847, 901679233, 619809906, 792602753, 694281979, 314091878, 106694624, 800976603, 115068474, 221763098, 22739694, 137808168, 359571266, 382310960, 520119128, 879690394, 262001347, 782120475, 661810862, 923812209, 705932677, 367743532, 291555734, 997488411, 365231936, 656787670, 654276074, 19508003, 676295673, 330571740, 350079743, 26375409, 356947149, 707026892, 733402301, 90349443, 797376335, 530778629, 621128072, 418504400, 949283029, 570411094, 988915494, 938198516, 508609603, 497525090, 435723599, 944333202, 441858285, 877581884, 821915079, 263773357, 141355234, 963270313, 227043663, 368398897, 331669203, 558712866, 927111763, 258780959, 817493825, 744605581, 3386533, 820880358, 565485932, 568872465, 389752816, 955238748, 524111206, 913864022, 869102763, 393213962, 307077977, 176180733, 569394695, 876472672, 52653398, 622048093, 498520758, 551174156, 173222242, 671743000, 222917149, 396139391, 67882384, 290799533, 686938924, 754821308, 45620834, 732559758, 487381059, 533001893, 265561644, 752942703, 285944589, 551506233, 304448929, 590393518, 141899744, 446348673, 36742184, 178641928, 624990601, 661732785, 840374713, 465365307, 127098085, 967472798, 432838098, 559936183, 527408974, 960247072, 520183248, 47592215, 7839280, 528022528, 575614743, 583454023, 111476544, 687091287, 270545303, 382021847, 69113127, 339658430, 721680277, 790793404, 130451827, 852132104, 642925501, 773377328, 625509425, 268434919, 41812240, 667321665, 935756584, 977568824, 644890482, 580647059, 558215876, 203106351, 783753410, 341969279, 545075630, 328829033, 670798312, 215873935, 544702968, 215501273, 431375208, 976078176, 191579442, 622954650, 599032819, 790612261, 413566904, 12599716, 803211977, 216778874, 229378590, 32590560, 249369434, 478748024, 511338584, 760708018, 239456035, 750794619, 511502630, 750958665, 501753277, 13255900, 764214565, 265967835, 279223735, 43438293, 309406128, 588629863, 632068156, 941474284, 530104140, 162172289, 103646566, 633750706, 795922995, 899569561, 533320260, 329243248, 228812802, 762133062, 91376303, 320189105, 82322160, 173698463, 493887568, 576209728, 749908191, 243795752, 820005480, 569913664, 813709416, 633714889, 203628546, 17337955, 651052844, 854681390, 872019345, 523072182, 377753565, 249772903, 772845085, 150598643, 400371546, 173216624, 323815267, 724186813, 897403437, 221218697, 945405510, 842808940, 64027630, 9433133, 852242073, 916269703, 925702836, 777944902, 694214598, 619917427, 397862322, 92076913, 711994340, 109856655, 201933568, 913927908, 23784556, 225718124, 139646025, 163430581, 389148705, 528794730, 692225311, 81374009, 610168739, 302394043, 383768052, 993936791, 296330827, 680098879, 674035663, 970366490, 650465362, 324501018, 294867501, 945332863, 269833874, 564701375, 510034231, 779868105, 344569473, 854603704, 634471802, 979041275, 833644972, 468116767, 447158035, 280803000, 748919767, 196077795, 476880795, 225800555, 421878350, 898759145, 124559693, 546438043, 445197181, 569756874, 116194910, 561392091, 131148958, 247343868, 808735959, 939884917, 187228778, 995964737, 935849647, 123078418, 119043148, 54892788, 177971206, 297014354, 351907142, 529878348, 826892702, 178799837, 708678185, 535570880, 714370717, 423048895, 958619775, 672990485, 96039373, 54659141, 727649626, 823688999, 878348140, 605997759, 429686751, 308034884, 914032643, 343719387, 651754271, 565786907, 909506294, 561260558, 127047458, 36553745, 597814303, 724861761, 761415506, 359229802, 84091556, 845507062, 204736857, 288828413, 134335468, 339072325, 627900738, 762236206, 101308524, 729209262, 491445461, 592753985, 321963240, 813408701, 406162679, 728125919, 541534613, 947697292, 675823204, 217357810, 165055095, 840878299, 58236102, 223291197, 64169489, 122405591, 345696788, 409866277, 532271868, 877968656, 287834926, 820106794, 698075443, 985910369, 806017156, 504092592, 490002954, 296020103, 800112695, 290115642, 586135745, 386248433, 676364075, 262499813, 648748246, 325112314, 587612127, 236360366, 561472680, 149084800, 385445166, 946917846, 96002639, 481447805, 428365644, 524368283, 5816081, 434181725, 958550008, 964366089, 398547807, 357097808, 321463890, 720011697, 77109498, 398573388, 118585078, 195694576, 594267964, 712853042, 908547618, 502815575, 215668610, 124216221, 627031796, 842700406, 966916627, 593948416, 436648815, 403565435, 997513851, 434162659, 837728094, 835241938, 269404590, 107132677, 942374615, 211779198, 318911875, 261286483, 473065681, 791977556, 53264032, 526329713, 318307262, 371571294, 897901007, 216208262, 587779556, 485680556, 701888818, 289668367, 775348923, 477237734, 766906101, 542255017, 19492744, 786398845, 328653855, 348146599, 134545437, 463199292, 811345891, 945891328, 409090613, 220436497, 166327818, 575418431, 795854928, 962182746, 537601170, 333456091, 295638830, 833240000, 166696084, 462334914, 295574907, 462270991, 924605905, 220180805, 682451796, 607057694, 827238499, 509690288, 116747975, 943986474, 453676755, 570424730, 514411197, 968087952, 538512675, 52923865, 21011810, 559524485, 612448350, 633460160, 192984638, 805432988, 438893141, 631877779, 437310760, 876203901, 508081673, 945392433, 821596327, 329677993, 275070419, 96666739, 426344732, 701415151, 798081890, 224426615, 925841766, 723923649, 948350264, 874192023, 598115665, 546465922, 420657938, 18773596, 565239518, 985897456, 4671045, 569910563, 555808012, 560479057, 130389613, 686197625, 246676675, 377066288, 63263906, 309940581, 687006869, 750270775, 60211349, 747218218, 497488986, 557700335, 304918546, 802407532, 360107860, 665026406, 467433931, 827541791, 492568190, 960002121, 787543905, 280112088, 240114202, 27658100, 307770188, 547884390, 575542490, 883312678};

signed main() {
	int S;
	scanf("%d", &S);

	printf("%d\n", ans[S - 1]);

	return 0;
}


#include<iostream>
#include<cstring>
#include<vector>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<map>
#include<utility>
#include<climits>
#include<set>
using namespace std;
#define ll long long

ll mod=1000000007;

ll dp[2005];
ll ans(int n)
{
	if(n==1 or n==2)
		return 0LL;
	else if(n==0)
		return 1LL;
	else if(dp[n]!=-1)
		return dp[n];
	else if(n==3 or n==4 or n==5)
		return 1LL;
	else
	{
		ll total=0;
		for(int i=3;i<=n;i++)
		{
			if(n-i>=0)
			total+=(ans(n-i)%mod);
		}
		return dp[n]=total;
	}
}
int main(){
	ios_base::sync_with_stdio(false);
	    cin.tie(0);
	    cout.tie(0);

	#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);
	    freopen("output.txt","w",stdout);
	#endif

	    memset(dp,-1,sizeof(dp));
	    dp[0]=0;
	    int n;cin>>n;
	    cout<<ans(n);
}


#include <iostream>
#include <string>
#include <set>
#include <algorithm>
#include <map>
#include <vector>
#include <cstdio>
#include <cmath>

#define endl '\n'

using namespace std;

void solve() {
	int n;
	cin >> n;
	if (n == 0) {
		cout << "1" << endl;
	} else {
		int arr[n], mod = 1000000007;
		arr[0] = 0; arr[1] = 0; arr[2] = 1;
		for (int i = 3; i < n; i++) {
			arr[i] = (arr[i - 1] + arr[i - 3]) % mod;
		}
		cout << arr[n - 1] << endl;
	}
}

int main() {
	int T = 1;
	cin >> T;
	while (T--) {
		solve();
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
ll S[2007];
int main()
{
    ll N;
    cin >> N;
    if(N<=2) cout << 0 << endl;
    else {
        ll ans  = 0;
        S[0] = 1;
        for(ll i=1;i<=N;i++)
        {
            S[i] = S[i-1]+S[max(0ll,i-3)];
            S[i] %= MOD;
        } cout << S[N-5] << endl;
    }
}


#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>
typedef long long LL;
typedef long double Lf;
#define in (void)scanf
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
//#define Rep(i,a,n)for(LL i=(LL)(a);i<(LL)(n);i++)
#define rep(i,n)Rep(i,0,n)
#define Repp(i,l,r,k)for(int i=(int)(l);i<(int)(r);i+=(int)(k))
//#define Repp(i,l,r,k)for(LL i=(LL)(l);i<(LL)(r);i+=(LL)(k))
#define Ma(x,y) ((x)>(y)?(x):(y))
#define mi(x,y) ((x)<(y)?(x):(y))
#define MOD 1000000007//998244353,1000000007,1000000009,4999999999999997
int upi(const void* a, const void* b) { return*(int*)a<*(int*)b ? -1 : *(int*)a> * (int*)b ? 1 : 0; }
int downi(const void* a, const void* b) { return*(int*)a<*(int*)b ? 1 : *(int*)a> * (int*)b ? -1 : 0; }
void sortupi(int* a, int n) { qsort(a, n, sizeof(int), upi); } //1,2,3,4,...
void sortdowni(int* a, int n) { qsort(a, n, sizeof(int), downi); }
int upLL(const void* a, const void* b) { return*(LL*)a<*(LL*)b ? -1 : *(LL*)a> * (LL*)b ? 1 : 0; }
int downLL(const void* a, const void* b) { return*(LL*)a<*(LL*)b ? 1 : *(LL*)a> * (LL*)b ? -1 : 0; }
void sortupLL(LL* a, int n) { qsort(a, n, sizeof(LL), upLL); }
void sortdownLL(LL* a, int n) { qsort(a, n, sizeof(LL), downLL); }
int cmp_char(const void* a, const void* b) { return *(char*)a - *(char*)b; } // a,b,c,d
int cmp_str(const void* a, const void* b) { return strcmp(*(const char**)a, *(const char**)b); } // aaa,aab
LL gcd(LL p, LL q) { while (q) { LL t = p % q; p = q; q = t; }return p; }
LL modpow(LL a,LL n,LL m){LL x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
#define invmodpow(b,p)modpow(b,p-2,p)// a/b≡a*b^{-1}(mod p)...return b^{-1}(mod p)
//typedef struct fac { LL n, exp; }F;
//LL fact(LL n,F*a){LL x=n,i,j,c=0;for(i=2;i*i<=x;i++){for(j=1;x%i==0;j++)x/=i;if(j>1){a[c].n=i;a[c++].exp=j-1;}}if(x-1){a[c].n=x;a[c++].exp=1;}return c;}
LL nibtan(LL* a,LL n,LL x){LL p=0,q=n/2,r=n-1;while(r-p>1){if(x>=a[q])p=q;if(x<=a[q])r=q;q=(p+r)/2;}return a[p]==x?p:r;}
//snippet

#define N 2009

void run(void) {
	LL s, ans = 0;
	in("%lld", &s);
	if (s > 2) {
		LL factorial[N] = { 1 };
		Rep(i, 1, N)factorial[i] = factorial[i - 1] * i % MOD;
		Rep(n, 1, 1 + s / 3) {
			ans += ((factorial[s - 2 * n - 1] % MOD * invmodpow(factorial[n - 1], MOD)) % MOD) * invmodpow(factorial[s - 3 * n], MOD) % MOD;
			ans %= MOD;
		}
	}
	printf("%lld\n", ans);
}

int main(void) {
	int test = 1;
//	in("%d", &test);
	while (test--) {
		run();
		fflush(stdout);
	}
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

ll a[2010];
ll cum[2010];
int main(){
	ll n;
	scanf("%lld",&n);
	a[0]=1;
	cum[0]=1;
	rep(i,3,n+1){
		a[i]=cum[i-3];
		cum[i]=(cum[i-1]+a[i])%MOD;
		//printf("%d %d %d\n",i,a[i],cum[i]);
	}
	printf("%lld",cum[n]);
}


#include <stdio.h>
int main(void) {
  int s;
  scanf("%d", &s);
  long long dp[s];
  for (int i = 0; i <= s; i++) {
    if (i < 3)
      dp[i] = 0;
    else if (i == 3)
      dp[i] = 1;
    else
      dp[i] = dp[i - 3] + dp[i - 1];
    dp[i] %= 1000000007;
  }
  printf("%lld\n", dp[s]);
  return 0;
}


#include<stdio.h>
#include<string.h>

#define mod 1000000007

long long int c_n = 1, c_r = 1, c_n_r = 1;
long long int g_current_answer = 0;

long long int multiple(long long int target, long long int p)
{
    long long int curretn_answer = 0;

    if (p == 0)
    {
        return 1;
    }

    if (p%2 == 0)
    {
        curretn_answer = multiple(target, (p/2))*multiple(target, (p/2));
        curretn_answer %= mod;
    } else {
        curretn_answer = multiple(target, ((p-1)/2))*multiple(target, ((p-1)/2));
        curretn_answer %= mod;
        curretn_answer *= target;
        curretn_answer %= mod;
    }

    return curretn_answer;
}

long long int cul_array_num(int array_num, int free_q)
{
    long long int current_answer = 0;

    if (array_num == 1)
    {
        return 1;
    } else if (array_num == 2){

        for (int i = 1; i<= (array_num -1 + free_q); i++)
        {
            c_n *= i;
            c_n %= mod;

            if (i<=free_q)
            {
                c_r *= i;
                c_r %= mod;
            }

            if (i<=(array_num - 1))
            {
                c_n_r *= i;
                c_n_r %= mod;
            }
        }

        current_answer = c_n*multiple((c_r*c_n_r)%mod, (mod-2));
        current_answer %= mod;
        g_current_answer = current_answer;
    } else {

        long long int tmp = 0;

        for (int i = 1; i <= 3; i++)
        {
            g_current_answer *= (free_q + i);
            g_current_answer %= mod;
        }

        tmp = (array_num*(array_num + free_q +1))%mod;
        tmp *= (array_num+free_q);
        tmp %= mod;

        g_current_answer *= multiple(tmp, (mod-2));
        g_current_answer %= mod;

        current_answer = g_current_answer;

    }

    return current_answer;

}

int main()
{
    int s, div = 0;
    long long int answer = 0;

    scanf("%d", &s);

    div = s/3;

    for (int i = 1; i <= div; i++)
    {
        answer += cul_array_num(i, (s - i*3));
    }

    answer %= mod;

    printf("%lld", answer);

    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main (void) {
    int n;
    scanf("%d", &n);
    long int a[n + 1];

    if (n == 1 || n == 2) {
        printf("0\n");
    } else {
        a[0] = 1;
        a[1] = 0;
        a[2] = 0;
        for (int i = 3; i <= n; i++) {
            a[i] = a[i - 1] + a[i - 3];
            if (a[i] >= 1000000007) {
                a[i] %= 1000000007;
            }
        }
    }
    printf("%ld\n", a[n]);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main (void) {
    int n;
    scanf("%d", &n);
    long int a[n + 1];

    if (n == 0) {
        printf("1\n");
    } else if (n == 1 || n == 2) {
        printf("0\n");
    } else {
        a[0] = 1;
        a[1] = 0;
        a[2] = 0;
        for (int i = 3; i <= n; i++) {
            a[i] = a[i - 1] + a[i - 3];
            if (a[i] >= 1000000007) {
                a[i] %= 1000000007;
            }
        }
    }
    printf("%ld\n", a[n]);
    return 0;
}


"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextssort(n,a){return a?cin.slice(cid,cid+=n).map(a=>+a).sort((a,b)=>b-a):cin.slice(cid,cid+=n).map(a=>+a).sort((a,b)=>a-b);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}
var streams=[];function print(s){streams.push(s);}
var mod = 1e9+7;
function mul(){for(var a=arguments,r=a[0],i=a.length;--i;)r=((r>>16)*a[i]%mod*65536+(r&65535)*a[i])%mod;return r;}
var fac=[],finv=[],invs=[],pow2=[];
function fset(n){
  fac.length=n+1,fac[0]=fac[1]=1;
  for(var i=2;i<=n;)fac[i]=mul(fac[i-1],i++);
  finv.length=n+1,finv[0]=finv[1]=1,finv[n]=inv(fac[n]);
  for(i=n;2<i;)finv[i-1]=mul(finv[i],i--);
  //invs.length=n+1,invs[0]=invs[1]=1;
  //for(i=2;i<=n;)invs[i]=mul(fac[i-1],finv[i++]);
  //pow2.length=n+1,pow2[0]=1;
  //for(i=1;i<=n;i++)pow2[i]=pow2[i-1]*2%mod;
}
function inv(b){for(var a=mod,u=0,v=1,t;b;v=t)t=a/b|0,a-=t*b,u-=t*v,t=a,a=b,b=t,t=u,u=v;u%=mod;return u<0?u+mod:u;}
function pow(a,n){for(var r=1;n;a=mul(a,a),n>>=1)if(n&1)r=mul(a,r);return r;}
function ncr(n,r){return mul(fac[n],finv[r],finv[n-r]);}
function npr(n,r){return mul(fac[n],finv[n-r]);}
function mput(n){return (n%mod+mod)%mod;}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));
if(streams.length)console.log(streams.join("\n"));

function main(){
  var s = next();
  var dp = xArray(0,s+1);
  dp[0] = 1;
  for(var i = 0; i < s; i++){
    for(var j = 3; j <= s; j++){
      if(i+j > s)break;
      dp[i+j] += dp[i];
      dp[i+j] %= mod;
    }
  }
  return dp[s];
}


const main = (input) => {
  const mod = (10**9 + 7)
  const s = Number(input.trim())

  const dp = [1, ...new Array(s).fill(0)]

  for (let x=3; x<dp.length; x++) {
    let sum = 0

    for (let i=x-3; i>=0; i--) {
      sum = (sum + dp[i]) % mod
    }

    dp[x] = sum
  }

  return console.log((dp[s] % mod + mod) % mod)
}

process.env.MYTEST
  ? (process.env.MYTEST === 'test' ? test() : main(require('fs').readFileSync('dev/stdin', 'utf8')))
  : main(require('fs').readFileSync('/dev/stdin', 'utf8'))


process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.split(/\n/);
    main();
});

function readLine() {
    return inputString[currentLine++];
}

const mod = Math.pow(10, 9) + 7
function main() {
  const s = Number(readLine())
  let maxLength = Math.floor(s / 3)
  let result = 0
  const { fac, finv } = comInit(s)
  for (let l = 1; l <= maxLength; l++) {
    const remain = s - l * 3
    result += com(remain + l - 1, l - 1, fac, finv)
    result %= mod
  }
  console.log(result)
}

function comInit(l) {
  let fac = [1n, 1n]
  let finv = [1n, 1n]
  let inv = [0n, 1n]
  const biMod = BigInt(mod)
  for (let i = 2; i <= l; i++){
    const biI = BigInt(i)
    fac[i] = fac[i - 1] * biI % biMod;
    inv[i] = biMod - inv[biMod % biI] * (biMod / biI) % biMod;
    finv[i] = finv[i - 1] * inv[i] % biMod;
  }
  return { fac, finv }
}

function com(n, k, fac, finv){
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  const biMod = BigInt(mod)
  return Number(fac[n] * (finv[k] * finv[n - k] % biMod) % biMod);
}


                               //ABHISHEK AGRAWAL,BIT mesra//
                      //Newbie......You have to be odd to be no. ONE :)//
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define fl float
#define lcm(a,b) (a*(b/__gcd(a,b)))
#define vs vector <string>
#define vc vector <char>
#define vii vector<int>
#define vll vector<ll>
#define sll set<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define plc pair<ll,char>
#define tlll tuple<ll,ll,ll>
#define mt make_tuple
#define vpll vector<pair<ll,ll>>
#define vpii vector<pair<int,int>>
#define vtll vector<tuple<ll,ll,ll>>
#define vvll vector<vector<ll>>
#define lb lower_bound
#define pb push_back
#define pob pop_back
#define f first
#define s second
#define mll map<ll,ll>
#define mp make_pair
#define sp(n) fixed<<setprecision(n)
#define mcl map<char,ll>
#define msl map<string,ll>
#define mod (ll)1000000007
#define flash ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define test ll t;read(t);while(t--)
#define sortv(v) sort(v.begin(),v.end())
#define INF (ll)(1e15)
#define loop(i,n) for(int i=0;i<n;i++)
#define loop1(i,n) for(int i=1;i<=n;i++)
#define rloop(n,i) for(int i=n-1;i>=0;i--)
#define loopab(i,a,b,c) for(int i=a;i<=b;i+=c)
#define reada(a,n) loop(i,n) cin>>a[i];
#define reada1(a,n) loop1(i,n) cin>>a[i];
#define sorta(a) sort(a,a+n,greater<ll>())
#define countone(n) __builtin_popcount(n)
#define numoftrailzero(n) __builtin_ctz(n)
#define maxpowoftwo(n) __builtin_clz(n)
#define leastindexwithone(n)  __builtin_ffs(n)
#define what_is(x) cerr << #x << " is " << x << endl;
#define pfv(v) cout<<v.size()<<"\n";loop(i,v.size()) cout<<v[i]<<" ";cout<<"\n";
#define pv(v) loop(i,v.size()) cout<<v[i]<<" ";
#define all(v) v.begin(),v.end()
#define mset(dp,val) memset(dp,val,sizeof(dp))
//if we need to devide any given number in powers of term the power of max term
#define answer(n) ceil(log2(n+1))
   int q;ll n;ll ans,sum;
// ll gcd(ll a, ll b){if (b==0){return a;} return gcd(b,a%b);}
 ll powe(ll a,ll b){ll res=1;while(b>0){if(b%2 ==1){res=(res*a);}a=(a*a);b/=2;} return res;}
ll power(ll a,ll b,ll M){a%=M;ll res=1;while(b>0){if(b%2 ==1){res=(res*a)%M;}a=(a*a)%M;b/=2;} return res;}
// ll extendedEuclid(ll A,ll B,ll &x,ll &y){
//     if(B == 0) {
//         x = 1;
//         y = 0;
//         return A;
//     }
//     else {
//         ll x1 , y1;
//         ll gcd = extendedEuclid(B,A%B,x1,y1);
//         y = x1-(A/B)*y1;
//         x = y1;
//         return gcd;
//     }
// }
// ll mi(ll A, ll M){ll x,y;extendedEuclid(A,M,x,y);if(x<0){x+=mod;} return x;}
// vector<bool>sieve(1000000,true);
// void Sieve(){
//  sieve[0]=false;
//  sieve[1]=false;
//  for(ll i=2;i*i<=1000000;i++){
//   if(sieve[i]==true){
//    for(ll j=i*i;j<1000000;j+=i)
//     sieve[j]=false;
//   }
//  }
// }
//  vll sieve_spf;
// void Sieve_spf(){
//  const ll n = 1e6 + 5;
//  sieve_spf.resize(n);

//  loop(i,n)
//   sieve_spf[i]=i;

//  sieve_spf[0]=-1;
//  sieve_spf[1]=1;

//  loopab(i,2,n,2)
//   sieve_spf[i]=2;

//  loopab(i,3,n,2)
//   if(sieve_spf[i]==i)
//    loopab(j,i*i,n,i)
//     if(sieve_spf[j]==j)
//      sieve_spf[j]=i;
// }
// #ifdef TESTING
// #define DEBUG fprintf(stderr, "====TESTING====\n")
// #define VALUE(x) cerr << "The value of " << #x << " is " << x << endl
// #define debug(...) fprintf(stderr, __VA_ARGS__)
// #else
// #define DEBUG
// #define VALUE(x)
// #define debug(...)
// #endif
// bool isUpcase(char c){
//     if(c >= 'A'&&c <= 'Z') return true;
//     else return false;
// }
// bool islowcase(char c){
//     if(c >= 'a'&&c <= 'z') return true;
//     else return false;
// }
void the_happiest_place_on_earth()
{
    flash;
  #ifdef ENABLE_FILE_IO
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
  #endif
}
// bool comp(const pii &a, const pii &b){
//  if(a.f<b.f&&a.s>=0&&b.s>=0)
//   return true;
//  else if(a.s<0&&b.s<0&&a.f+a.s>b.f+b.s)
//   return true;
//  else
//   return false;
// }

const int N=1900055;ll b[N],a[N],dis[N],par[N];
vii graph[N];bool vis[N];
// bool vis[N];mll m1;
// map<pii,int>k;
// void gra(ll m){
//   loop(i,m){
//     ll x,y,w;cin>>x>>y>>w;
//     x--,y--;
//     graph[x].pb({y,w});
//     graph[y].pb({x,w});
//   }
// }
// ll cnt;int val[N]={0};
void dfs(int node,int pa){
  vis[node]=true;
  par[node]=pa;
  for(int x:graph[node]){
    if(!vis[x]){
      dfs(x,node);
    }
  }
  //order.pb(node);
}
// void dfs1(int node,int c){
//   vis[node]=true;
//   cmp[node]=c;
//   for(int x:graph1[node]){
//     if(!vis[x]) dfs1(x,c);
//   }
// }
ll t;
void testcase(){
  cin>>n;
  vii v;ll dp[n+1]={0};
  for(int i=3;i<=n;i++) v.pb(i);
  //pv(v);
  dp[0]=1;
  loop1(i,n){
    for(auto x:v){
      if(x<=i){dp[i]=(dp[i]+dp[i-x])%mod;}
    }
  }
  //loop1(i,n) cout<<dp[i]<<" ";
  cout<<dp[n];
  return;
}

int main(){
  //the_happiest_place_on_earth;
  //Today's thought: Push yourself,because no one else is going to do it for you.
  //Things aren’t always #000000 and #FFFFFF
  //START OF PROGRAM LOGIC
  //g++ -o a BB.cpp -DENABLE_FILE_IO;./a
  the_happiest_place_on_earth();
  // dp[0]=1;
  // loop1(i,N){
  //   dp[i]=dp[i-1]*i;
  //   dp[i]%=mod;
  // }
  q=1;
  //cin>>t>>q;
  while(q--){
    //cout<<"Case #"<<++t<<": ";
    testcase();
  }
  cerr << "Time : " << 1000 *((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
  //END OF PROGRAM LOGIC
	return 0;
}
/*
######  ###### #     # ####### #     # ##### #     #    #    ####### ####### ######
#     # #      ##    # #     # ##   ##   #   ##    #   # #      #    #     # #     #
#     # #      # #   # #     # # # # #   #   # #   #  #   #     #    #     # #     #
#     # #####  #  #  # #     # #  #  #   #   #  #  # #     #    #    #     # ######
#     # #      #   # # #     # #     #   #   #   # # #######    #    #     # #   #
#     # #      #    ## #     # #     #   #   #    ## #     #    #    #     # #    #
######  ###### #     # ####### #     # ##### #     # #     #    #    ####### #     #
*/


function seqs(n) {
	let num = Number(n);
  	let count = 0;
  	if(num < 3) {
		return count;
	} else {
	for(let i = 3; i < num; i++) {
		if(num - i > 3)
          count++;
		}
    }
  	return count%(10**9 + 7);
]

console.log(seqs(require("fs").readFileSync("/dev/stdin", "utf8")));


function Main(input) {
	const amari = Math.pow(10, 9) + 7;
}

// Main(require("fs").readFileSync("sample.txt", "utf8"));  // テスト用
Main(require("fs").readFileSync("/dev/stdin", "utf8"));   // 提出用


package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"os"
	"sort"
	"strconv"
)

const (
	initialBufSize = 1e4
	maxBufSize     = 1e6 + 7
)

var buf []byte = make([]byte, initialBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

var d = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}}
var d8 = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}}

const mod = int(1e9) + 7

// DP

func main() {
	S := nextInt()
	dp := make([]int, 2001)
	dp[3] = 1
	for i := 4; i <= S; i++ {
		dp[i] = (dp[i-1] + dp[i-3]) % mod
	}
	fmt.Println(dp[S])
}

// Position として迷路問題での現在地を表す構造体を定義
type Position struct {
	H int
	W int
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func abs(a int) int {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func pow(p, q int) int {
	res := p
	if q == 0 {
		return 1
	}
	for i := 0; i < q-1; i++ {
		res *= p
	}
	return res
}

func ceil(a, b int) int {
	return (a + (b - 1)) / b
}

func MinOf(vars ...int) int {
	min := vars[0]
	for _, i := range vars {
		if min > i {
			min = i
		}
	}
	return min
}

func MaxOf(vars ...int) int {
	max := vars[0]
	for _, i := range vars {
		if max < i {
			max = i
		}
	}
	return max
}

func gcdof2numbers(a int, b int) int {
	if b == 0 {
		return a
	}
	return gcdof2numbers(b, a%b)
}

func lcmof2numbers(a int, b int) int {
	return a / gcdof2numbers(a, b) * b
}

// マイナスの場合は考慮していない
func fuctorial(a int) int {
	if a == 1 || a == 0 {
		return 1
	} else {
		return fuctorial(a-1) * a
	}
}

// NextPermutation はsortインターフェース（要はソート済みスライス）から次の順列にスライスを並べ替える
// https://play.golang.org/p/ljft9xhOEn
func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}

// PrimeFactorize 素因数分解したmapを返す
func PrimeFactorize(n int) map[int]int {
	pf := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			pf[i]++
			n /= i
		}
	}
	if n != 1 {
		pf[n]++
	}
	return pf
}

// FastPrimeFactorize osa_k法を使った高速素因数分解
// sieveを作るところのjはi*2スタートでもよい？
// https://qiita.com/rsk0315_h4x/items/ff3b542a4468679fb409
func FastPrimeFactorize(n int, sieve []int) map[int]int {
	pf := make(map[int]int)
	for n > 1 {
		pf[sieve[n]]++
		n /= sieve[n]
	}
	return pf
}

// MakeSieve は高速素数判定に使う篩を作る。
// Sieve[i] < i なら合成数なので、Sieveは素数判定にも使える
func MakeSieve(max int) []int {
	sieve := make([]int, max)
	for i := range sieve {
		sieve[i] = i
	}
	for i := 2; i*i <= max; i++ {
		if sieve[i] == i {
			for j := i; j < max; j += i {
				if sieve[j] == j {
					sieve[j] = i
				}
			}
		}
	}
	return sieve
}

// golangの公式サンプルより
// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap
// IntHeap は，整数の最小ヒープです。
type IH []int

func (h IH) Len() int           { return len(h) }
func (h IH) Less(i, j int) bool { return h[i] < h[j] }
func (h IH) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }

func (h *IH) Push(x interface{}) {
	// Push と Pop はポインタレシーバを使っています。
	// なぜなら，スライスの中身だけでなく，スライスの長さも変更するからです。
	*h = append(*h, x.(int))
}

func (h *IH) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

// golangの公式サンプルより
// https://xn--go-hh0g6u.com/pkg/container/heap/#example__priorityQueue

// Item は，優先キューで管理する項目です。
type Item struct {
	value    string // 値。任意です。
	priority int    // キューにおける優先度
	// index は heap.Interface メソッドで更新されます。
	index int // ヒープにおけるインデックス
}

// PriorityQueue は heap.Interface を実装し，Item のリストを保持します。
type PriorityQueue []*Item

func (pq PriorityQueue) Len() int { return len(pq) }

func (pq PriorityQueue) Less(i, j int) bool {
	// Pop が最小ではなく最大の優先度を持つ項目を返して欲しいので，ここでは > を使っています。
	return pq[i].priority > pq[j].priority
}

func (pq PriorityQueue) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

func (pq *PriorityQueue) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Item)
	item.index = n
	*pq = append(*pq, item)
}

func (pq *PriorityQueue) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	old[n-1] = nil  // メモリリークを避ける
	item.index = -1 // 安全のため
	*pq = old[0 : n-1]
	return item
}

// update はキューの Item の優先度と値を更新します。
func (pq *PriorityQueue) update(item *Item, value string, priority int) {
	item.value = value
	item.priority = priority
	heap.Fix(pq, item.index)
}

// UnionFind の定義
// 下記を参考
// https://youtu.be/TdR816rqc3s?t=6822
// https://github.com/atcoder/live_library/blob/master/uf.cpp
// https://qiita.com/haru1843/items/2295d0ec1f5002bd5c33#%E5%AE%9F%E8%A3%85
type UnionFind struct {
	parent []int
	maxlen int
}

// UnionFind のスライス初期化
func newUnionFind(N int) *UnionFind {
	u := new(UnionFind)
	u.parent = make([]int, N)
	u.maxlen = 1
	for i := range u.parent {
		u.parent[i] = -1
	}
	return u
}

// xの根を見つける
func (u *UnionFind) find(x int) int {
	if u.parent[x] < 0 {
		return x
	}
	u.parent[x] = u.find(u.parent[x])
	return u.parent[x]
}

// xとyのグループを結合する
func (u *UnionFind) unite(x, y int) {
	xf := u.find(x)
	yf := u.find(y)
	if xf == yf {
		return
	}
	// 常に大きい方に小さい木をくっつける
	if xf > yf {
		xf, yf = yf, xf
	}
	u.parent[xf] += u.parent[yf]
	u.parent[yf] = xf
	if u.parent[xf] < 0 {
		u.maxlen = MaxOf(u.maxlen, abs(u.parent[xf]))
	}
}

// xとyが同じグループに所属するかどうかを返す
func (u *UnionFind) same(x, y int) bool {
	if u.find(x) == u.find(y) {
		return true
	}
	return false
}

// xの所属するグループの木の大きさを返す
func (u *UnionFind) size(x int) int {
	return -u.parent[u.find(x)]
}

// 根の数を返す
func (u UnionFind) rootcnt() int {
	var cnt int
	for _, v := range u.parent {
		if v < 0 {
			cnt++
		}
	}
	return cnt
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var s, a int
	a = int(math.Pow(10, 9)) + 7
	fmt.Scan(&s)
	A := make([]int, 2001)
	A[0] = 1
	A[1] = 0
	A[2] = 0
	var i = 3
	for ; i <= s; i++ {
		A[i] = (A[i-1] + A[i-3]) % a
	}
	i--
	var ans = A[i] % a
	fmt.Println(ans)
}


package main

import (
	"fmt"
)

const mod = 1000000007

func main() {
	var s int
	fmt.Scan(&s)
	dp := make([]int, s+1)
	dp[0] = 1
	for i := 1; i <= s; i++ {
		if i < 3 {
			dp[i] = 0
			continue
		}
		dp[i] = dp[i-1] + dp[i-3]
		dp[i] %= mod
	}
	ans := dp[s]
	ans %= mod
	fmt.Println(ans)
}


package main

import (
	"fmt"
)

func main() {
	mod := 1000000007
	var s int
	fmt.Scan(&s)

	dp := make([]int , s+1)
	dp[0] = 1
	for i := 1; i < s+1; i++{
		for j := 0; j < (i-3)+1; j++ {
			dp[i] += dp[j]
			dp[i] = dp[i]%mod
		}
	}
	println(dp[s])

}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const mod int = 1e9 + 7

var s int

func main() {
	readVariables()
	fmt.Println(solve2(s))
	// for i := 1; i <= s; i++ {
	// 	if solve1(s) != solve2(s) {
	// 		fmt.Println(s, solve1(s), solve2(s))
	// 	}
	// }
}

// O(S^2)
func solve1(s int) int {
	var dp [3000]int
	dp[0] = 1
	for i := 1; i <= s; i++ {
		for j := 3; i-j >= 0; j++ {
			dp[i] += dp[i-j]
		}
		dp[i] %= mod
	}
	answer := dp[s]
	return answer
}

// intended O(S)
func solve2(s int) int {
	var dp [3000]int
	dp[0] = 1
	get := func(i int) int {
		if i < 0 {
			return 0
		}
		return dp[i]
	}
	for i := 1; i <= s; i++ {
		dp[i] = dp[i-1] + get(i-3)
		dp[i] %= mod
	}
	answer := get(s) - get(s-1)
	return answer
}

func readVariables() {
	s = nextInt()

}

/* Template */

var scanner *bufio.Scanner

func init() {
	Max := 1001001
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]byte, 0, Max), Max)
	scanner.Split(bufio.ScanWords)
}

//nextInt converts next token from stdin and returns integer value.
//nextInt panics when conversion into an integer fails.
func nextInt() int {
	if !scanner.Scan() {
		panic("No more token.")
	}
	num, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic("nextInt(): cannot convert to int: " + scanner.Text())
	}
	return num
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var dp [3000]int
var s int

const mod int = 1e9 + 7

func main() {
	readVariables()
	dp[0] = 1
	for i := 1; i <= s; i++ {
		dp[i] = dp[i-1] + get(i-3)
		dp[i] %= mod
	}
	answer := get(s) - get(s-1)
	fmt.Println(answer)
}

func get(i int) int {
	if i < 0 {
		return 0
	}
	return dp[i]
}

func readVariables() {
	s = nextInt()

}

/* Template */

var scanner *bufio.Scanner

func init() {
	Max := 1001001
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]byte, 0, Max), Max)
	scanner.Split(bufio.ScanWords)
}

//nextInt converts next token from stdin and returns integer value.
//nextInt panics when conversion into an integer fails.
func nextInt() int {
	if !scanner.Scan() {
		panic("No more token.")
	}
	num, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic("nextInt(): cannot convert to int: " + scanner.Text())
	}
	return num
}


D,M=[t=0]*3,10**9+7
0.upto(gets.to_i){D[_1+3]=1+t+=D[_1]}
p D[-4]%M


s = gets.to_i
dp = [0]*(s+1)
dp[0] = 1
x = 0
(3..s).each do |i|
  x += dp[i-3]
  x %= 10**9+7
  dp[i] = x
end
puts dp[s]


s = gets.to_i
m = 10 ** 9 + 7
d = [1, 0, 0]
(3..s).each do
  d << (d.last + d.shift) % m
end
puts d.last


D,M = [],10**9+7
3.upto(S=gets.to_i) {|s| D[s] = (3..s-3).sum(1){D[_1]} }
p D[S]%M


D,M = [],10**9+7
S = gets.to_i
3.upto(S) { D[s] = (3..s-3).sum(1){D[_1]} }
p D[S]%M


def C(n,k)
  if n==1
    return 1
  elsif k==0 || k==n
    return 1
  else
    return C(n-1,k-1)+C(n-1,k)
  end
end
#重複組み合わせ
#n個の異なるものからr個取ってくる・・・H(n,r)とおく
def H(n,r)
  return C(n+r-1,r)
end

#以下本題
n = gets.to_i
t = n/3 #１からtまで
sum = 0
for k in 1..t
  sum += H(k,n-3*k)
end
puts sum%(10**9+7)


#![allow(unused_imports, non_snake_case, dead_code)]
use proconio::{
    input, fastout,
    marker::{Chars, Bytes, Usize1}
};

const MODULO: u64 = 1_000_000_007;

struct Combination {
    MOD: u64,
    size: usize,
    fact: Vec<u64>,
    inv_fact: Vec<u64>,
}
impl Combination {
    fn new(size: usize, MOD: u64) -> Self {
        let mut fact = vec![1; size + 1];
        let mut inv_fact = vec![1; size + 1];
        for i in 1..size + 1 {
            fact[i] = fact[i - 1] * i as u64 % MOD;
        }
        inv_fact[size] = Self::modpow(fact[size], MOD - 2, MOD);
        for i in (1..size + 1).rev() {
            inv_fact[i - 1] = inv_fact[i] * i as u64 % MOD;
        }
        Combination {
            MOD,
            size,
            fact,
            inv_fact,
        }
    }
    fn modpow(mut x: u64, mut y: u64, m: u64) -> u64 {
        let mut res: u64 = 1;
        while y > 0 {
            if y & 1 > 0 {
                res = res * x % m;
            }
            x = x * x % m;
            y >>= 1;
        }
        res
    }
    fn modinv(x: u64, m: u64) -> u64 {
        Self::modpow(x, m - 2, m)
    }
    fn nPr(&self, n: usize, r: usize) -> u64 {
        if n < r {
            return 0;
        };
        self.fact[n] * self.inv_fact[n - r] % self.MOD
    }
    fn nCr(&self, n: usize, r: usize) -> u64 {
        if n < r {
            return 0;
        };
        self.fact[n] * self.inv_fact[r] % self.MOD * self.inv_fact[n - r] % self.MOD
    }
}

#[fastout]
fn main() {
    input!{
        N: usize
    }
    let ncr = Combination::new(N * 2, MODULO);
    let mut ans = 0;
    for i in 1..N/3+1 {
        ans = (ans + ncr.nCr(N-i*3+i-1, i-1)) % MODULO;
    }
    println!("{}", ans);

}


#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::HashMap;
#[allow(unused_imports)]
use std::collections::VecDeque;
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::mem::*;
#[allow(unused_imports)]
use std::str::*;
#[allow(unused_imports)]
use std::usize;

#[allow(unused_macros)]
macro_rules! read_cols {
    ($($t:ty),+) => {{
        let mut line = String::new();
        stdin().read_line(&mut line).unwrap();

        let mut it = line.trim()
            .split_whitespace();

        ($(
            it.next().unwrap().parse::<$t>().ok().unwrap()
        ),+)
    }}
}

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let mut line = String::new();
    stdin().read_line(&mut line).unwrap();
    line.trim().to_string().parse().ok().unwrap()
}

#[allow(dead_code)]
fn read_vec<T: FromStr>() -> Vec<T> {
    let mut line = String::new();
    stdin().read_line(&mut line).unwrap();

    line.trim()
        .split_whitespace()
        .map(|s| s.parse().ok().unwrap())
        .collect()
}

const M: i64 = 1000000007;

fn main() {
    let s: i64 = read();

    let mut fact = vec![1, 1];
    let mut ifact = vec![1, 1];
    let mut inv = vec![1, 1];
    for i in 2..=4000i64 {
        fact.push(fact.last().unwrap() * i % M);
        inv.push((M - (M / i) * inv[(M % i) as usize] % M) % M);
        ifact.push(ifact.last().unwrap() * inv.last().unwrap() % M);
    }

    let combi =
        |n: i64, m: i64| fact[n as usize] * ifact[(n - m) as usize] % M * ifact[m as usize] % M;

    let ans = (1..=2000)
        .take_while(|n| 3 * n <= s)
        .map(|n| {
            let ss = s - n * 3;

            // println!("{} {}", n, combi(ss + n - 1, n - 1));
            combi(ss + n - 1, n - 1)
        })
        .fold(0, |acc, a| (acc + a) % M);

    println!("{}", ans);
}


use num::{One, Zero};
use proconio::input;
type ModInt = modint::ModInt<modint::M1000000007>;

fn main() {
    input!(s: usize);

    let mut dp = vec![ModInt::zero(); s + 1];
    dp[0] = ModInt::one();
    for i in 3..=s {
        dp[i] = dp[i - 1] + dp[i - 3];
    }
    let ans = dp[s];

    println!("{}", ans);
}

#[allow(dead_code)]
mod modint {
    //! For the modular arithmetic.

    use num::{
        self,
        integer::Integer,
        traits::{Inv, Num, One, Pow, Zero},
    };
    use std::{
        cell::RefCell,
        convert::Infallible,
        fmt,
        iter::{Product, Sum},
        marker::PhantomData,
        ops::{
            Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Rem, RemAssign, Sub, SubAssign,
        },
        str::FromStr,
        thread::LocalKey,
    };

    #[derive(Copy, Clone, Eq, PartialEq, Hash)]
    #[repr(transparent)]
    pub struct ModInt<M>(u32, PhantomData<fn() -> M>);

    impl<M: Modulus> ModInt<M> {
        pub fn new<V: ModU32>(val: V) -> Self { val.into() }
        pub fn modulus() -> u32 { M::modulus() }
        pub fn val(self) -> u32 { self.0 }
        /// # Safety
        /// `val` must be less than `modulus`
        pub unsafe fn raw(val: u32) -> Self { Self(val, PhantomData) }
    }

    impl<M: Modulus> Default for ModInt<M> {
        fn default() -> Self { Self::zero() }
    }

    impl<M: Modulus, V: ModU32> From<V> for ModInt<M> {
        fn from(val: V) -> Self { unsafe { Self::raw(val.mod_u32(Self::modulus())) } }
    }

    impl<M: Modulus> FromStr for ModInt<M> {
        type Err = Infallible;
        fn from_str(src: &str) -> Result<Self, Infallible> { Self::from_str_radix(src, 10) }
    }

    impl<M: Modulus> fmt::Display for ModInt<M> {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            fmt::Display::fmt(&self.val(), f)
        }
    }
    impl<M: Modulus> fmt::Debug for ModInt<M> {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Debug::fmt(&self.val(), f) }
    }

    impl<M: Modulus> Zero for ModInt<M> {
        fn zero() -> Self { unsafe { Self::raw(0) } }
        fn is_zero(&self) -> bool { self.0 == 0 }
    }
    impl<M: Modulus> One for ModInt<M> {
        fn one() -> Self { unsafe { Self::raw(1) } }
    }

    impl<M: Modulus> Neg for ModInt<M> {
        type Output = Self;
        fn neg(self) -> Self { Self::zero() - self }
    }
    impl<M: Modulus> Inv for ModInt<M> {
        type Output = Self;
        fn inv(self) -> Self {
            assert_ne!(self.0, 0, "attempt to get inverse of zero");
            let e = i64::extended_gcd(&self.0.into(), &M::modulus().into());
            assert_ne!(e.gcd, 1, "multiplicative inverse does not exist");
            Self::from(e.x)
        }
    }

    impl<M: Modulus> Add for ModInt<M> {
        type Output = Self;
        fn add(self, rhs: Self) -> Self {
            let m = M::modulus();
            let val = self.0 + rhs.0;
            unsafe { Self::raw(if val >= m { val - m } else { val }) }
        }
    }
    impl<M: Modulus> Sub for ModInt<M> {
        type Output = Self;
        fn sub(self, rhs: Self) -> Self {
            let m = M::modulus();
            let val = self.0.wrapping_sub(rhs.0);
            unsafe { Self::raw(if val >= m { val.wrapping_add(m) } else { val }) }
        }
    }
    impl<M: Modulus> Mul for ModInt<M> {
        type Output = Self;
        fn mul(self, rhs: Self) -> Self {
            unsafe { Self::raw((self.0 as u64 * rhs.0 as u64 % M::modulus() as u64) as u32) }
        }
    }
    #[allow(clippy::suspicious_arithmetic_impl)]
    impl<M: Modulus> Div for ModInt<M> {
        type Output = Self;
        fn div(self, rhs: Self) -> Self { self * rhs.inv() }
    }
    /// always return zero, unless `rhs == 0`.
    impl<M: Modulus> Rem for ModInt<M> {
        type Output = Self;
        fn rem(self, rhs: Self) -> Self {
            assert_ne!(rhs.0, 0, "attempt to divide by zero");
            Self::zero()
        }
    }
    macro_rules! forward_ref_binop {
        ($trait:ident, $op:ident) => {
            impl<'a, M: Modulus> $trait<ModInt<M>> for &'a ModInt<M> {
                type Output = ModInt<M>;
                fn $op(self, rhs: ModInt<M>) -> ModInt<M> { (*self).$op(rhs) }
            }
            impl<M: Modulus> $trait<&ModInt<M>> for ModInt<M> {
                type Output = ModInt<M>;
                fn $op(self, rhs: &ModInt<M>) -> ModInt<M> { self.$op(*rhs) }
            }
            impl<M: Modulus> $trait<&ModInt<M>> for &ModInt<M> {
                type Output = ModInt<M>;
                fn $op(self, rhs: &ModInt<M>) -> ModInt<M> { self.$op(*rhs) }
            }
        };
    }
    forward_ref_binop!(Add, add);
    forward_ref_binop!(Sub, sub);
    forward_ref_binop!(Mul, mul);
    forward_ref_binop!(Div, div);
    forward_ref_binop!(Rem, rem);

    macro_rules! binop_assign {
        ($assign_trait:ident, $assign:ident, $op:ident) => {
            impl<M: Modulus> $assign_trait for ModInt<M> {
                fn $assign(&mut self, rhs: Self) { *self = self.$op(rhs) }
            }
        };
    }
    binop_assign!(AddAssign, add_assign, add);
    binop_assign!(SubAssign, sub_assign, sub);
    binop_assign!(MulAssign, mul_assign, mul);
    binop_assign!(DivAssign, div_assign, div);
    binop_assign!(RemAssign, rem_assign, rem);
    macro_rules! forward_ref_op_assign {
        ($trait:ident, $op:ident) => {
            impl<M: Modulus> $trait<&ModInt<M>> for ModInt<M> {
                #[inline]
                fn $op(&mut self, rhs: &ModInt<M>) { self.$op(*rhs) }
            }
        };
    }
    forward_ref_op_assign!(AddAssign, add_assign);
    forward_ref_op_assign!(SubAssign, sub_assign);
    forward_ref_op_assign!(MulAssign, mul_assign);
    forward_ref_op_assign!(DivAssign, div_assign);
    forward_ref_op_assign!(RemAssign, rem_assign);

    impl<M: Modulus> Num for ModInt<M> {
        type FromStrRadixErr = Infallible;
        fn from_str_radix(src: &str, radix: u32) -> Result<Self, Infallible> {
            assert!(2 <= radix && radix <= 36, "radix must be in `[2, 36]`");
            assert!(!src.is_empty(), "attempt to parse empty str");
            let src = src.as_bytes();
            let (positive, digits) = match src[0] {
                b'+' => (true, &src[1..]),
                b'-' => (false, &src[1..]),
                _ => (true, src),
            };
            assert!(!digits.is_empty(), "attempt to parse sign");
            let mut result = 0_u64;
            for &c in digits {
                let x = (c as char).to_digit(radix).expect("found invalid char") as u64;
                result = (result * 10 + x) % M::modulus() as u64;
            }
            let ret = unsafe { Self::raw(result as u32) };
            Ok(if positive { ret } else { -ret })
        }
    }

    impl<M: Modulus> Pow<u64> for ModInt<M> {
        type Output = Self;
        fn pow(mut self, mut exp: u64) -> Self {
            let mut acc = Self::one();
            while exp > 0 {
                if exp & 1 == 1 {
                    acc *= self;
                }
                self *= self;
                exp >>= 1;
            }
            acc
        }
    }

    impl<M: Modulus> Sum for ModInt<M> {
        fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
            iter.fold(Self::zero(), |acc, x| acc + x)
        }
    }
    impl<'a, M: Modulus> Sum<&'a Self> for ModInt<M> {
        fn sum<I: Iterator<Item = &'a Self>>(iter: I) -> Self {
            iter.fold(Self::zero(), |acc, x| acc + *x)
        }
    }
    impl<M: Modulus> Product for ModInt<M> {
        fn product<I: Iterator<Item = Self>>(iter: I) -> Self {
            iter.fold(Self::zero(), |acc, x| acc + x)
        }
    }
    impl<'a, M: Modulus> Product<&'a Self> for ModInt<M> {
        fn product<I: Iterator<Item = &'a Self>>(iter: I) -> Self {
            iter.fold(Self::zero(), |acc, x| acc + *x)
        }
    }

    pub trait Modulus: 'static + Copy + Eq {
        fn modulus() -> u32;
    }

    #[macro_export]
    macro_rules! static_modulus {
        (type $type:ident : u32 = $val:expr) => {
            #[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug)]
            pub enum $type {}
            impl Modulus for $type {
                fn modulus() -> u32 { $val }
            }
        };
    }
    static_modulus!(type M998244353: u32 = 998_244_353);
    static_modulus!(type M1000000007: u32 = 1_000_000_007);

    /// default modulus is `998_244_353`
    #[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug)]
    pub enum DynamicModulus {}
    impl DynamicModulus {
        pub fn set(modulus: u32) {
            assert_ne!(modulus, 0, "modulus must not be 0");
            Self::value_key().with(|val| *val.borrow_mut() = modulus)
        }
        fn value_key() -> &'static LocalKey<RefCell<u32>> {
            thread_local!(static MOD: RefCell<u32> = RefCell::new(998_244_353));
            &MOD
        }
    }
    impl Modulus for DynamicModulus {
        fn modulus() -> u32 { Self::value_key().with(|val| *val.borrow()) }
    }

    pub trait ModU32 {
        fn mod_u32(self, rhs: u32) -> u32;
    }
    macro_rules! mod_u32_for_small {
        ($($type:ty),*) => {$(
            impl ModU32 for $type {
                fn mod_u32(self, rhs:u32) -> u32 {
                        (self as i128).rem_euclid(rhs as i128) as u32
                    }
                }
        )*};
    }
    macro_rules! mod_u32_for_large {
        ($($type:ty),*) => {$(
            impl ModU32 for $type {
                fn mod_u32(self, rhs:u32) -> u32 {
                    self.rem_euclid(rhs as $type) as u32
                }
            }
        )*};
    }
    mod_u32_for_small!(i8, i16, i32, i64, i128, isize, u8, u16, u32, u64);
    mod_u32_for_large!(u128);
    #[cfg(target_pointer_width = "32")]
    mod_u32_for_small!(usize);
    #[cfg(target_pointer_width = "64")]
    mod_u32_for_small!(usize);
}


// -*- coding:utf-8-unix -*-

use std::cmp::*;
use std::collections::*;
use std::fs::File;
use std::io::prelude::*;
use std::io::*;
use std::vec;

const INF: i64 = 1223372036854775807;
const MEM_SIZE: usize = 202020;
// const MOD: i64 = 1000000007;
const MOD: i64 = 7;
use std::cmp::*;
use std::collections::*;
use std::io::stdin;
use std::io::stdout;
use std::io::Write;
#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

#[allow(unused_macros)]
macro_rules! p {
    ([$($x:expr), *]) => {{
        let mut f = true;
        $(
            print!("{}{}", if f {""} else {" "}, $x);
            f = false;
        )*
78786    print!("\n");
    }};
    ($x:expr) => {{
        let mut f = true;
        for a in $x.iter() {
            print!("{}{}", if f {""} else {" "}, a);
            f = false;
        }
        print!("\n");
    }};
}
#[allow(dead_code)]
fn readii() -> (i64, i64) {
    let mut str = String::new();
    let _ = stdin().read_line(&mut str).unwrap();
    let mut iter = str.split_whitespace();
    (
        iter.next().unwrap().parse::<i64>().unwrap(),
        iter.next().unwrap().parse::<i64>().unwrap(),
    )
}
#[allow(dead_code)]
fn readuu() -> (usize, usize) {
    let mut str = String::new();
    let _ = stdin().read_line(&mut str).unwrap();
    let mut iter = str.split_whitespace();
    (
        iter.next().unwrap().parse::<usize>().unwrap(),
        iter.next().unwrap().parse::<usize>().unwrap(),
    )
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

macro_rules! mint {
    (a :expr ) => {
        Mint::new({ a })
    };
}
#[derive(Copy, Clone)]
pub struct Mint(i64);
impl Mint {
    fn new(x: i64) -> Self {
        Mint(x.rem_euclid(MOD))
    }
    fn pow(self, n: usize) -> Self {
        match n {
            0 => Mint::new(1),
            _ => {
                let mut a = self.pow(n >> 1);
                a *= a;
                if n & 1 == 1 {
                    a *= self;
                }
                a
            }
        }
    }
    fn inv(self) -> Self {
        self.pow((MOD - 2) as usize)
    }
}
impl std::ops::Neg for Mint {
    type Output = Mint;
    fn neg(self) -> Self::Output {
        Self::new(-self.0)
    }
}
impl std::ops::AddAssign<Mint> for Mint {
    fn add_assign(&mut self, rhs: Self) {
        self.0 += rhs.0;
        self.0 %= MOD;
    }
}
impl std::ops::AddAssign<i64> for Mint {
    fn add_assign(&mut self, rhs: i64) {
        *self += Mint::new(rhs);
    }
}
impl std::ops::AddAssign<usize> for Mint {
    fn add_assign(&mut self, rhs: usize) {
        *self += Mint::new(rhs as i64);
    }
}
impl<T> std::ops::Add<T> for Mint
where
    Mint: std::ops::AddAssign<T>,
{
    type Output = Self;
    fn add(self, other: T) -> Self {
        let mut res = self;
        res += other;
        res
    }
}
impl std::ops::SubAssign<Mint> for Mint {
    fn sub_assign(&mut self, rhs: Self) {
        self.0 -= rhs.0;
        if self.0 < 0 {
            self.0 += MOD;
        }
    }
}
impl std::ops::SubAssign<i64> for Mint {
    fn sub_assign(&mut self, rhs: i64) {
        *self -= Mint::new(rhs);
    }
}
impl std::ops::SubAssign<usize> for Mint {
    fn sub_assign(&mut self, rhs: usize) {
        *self -= Mint::new(rhs as i64);
    }
}
impl<T> std::ops::Sub<T> for Mint
where
    Mint: std::ops::SubAssign<T>,
{
    type Output = Self;
    fn sub(self, other: T) -> Self {
        let mut res = self;
        res -= other;
        res
    }
}
impl std::ops::MulAssign<Mint> for Mint {
    fn mul_assign(&mut self, rhs: Self) {
        self.0 *= rhs.0;
        self.0 %= MOD;
    }
}
impl std::ops::MulAssign<i64> for Mint {
    fn mul_assign(&mut self, rhs: i64) {
        *self *= Mint::new(rhs);
    }
}
impl std::ops::MulAssign<usize> for Mint {
    fn mul_assign(&mut self, rhs: usize) {
        *self *= Mint::new(rhs as i64);
    }
}
impl<T> std::ops::Mul<T> for Mint
where
    Mint: std::ops::MulAssign<T>,
{
    type Output = Self;
    fn mul(self, other: T) -> Self {
        let mut res = self;
        res *= other;
        res
    }
}
impl std::ops::DivAssign<Mint> for Mint {
    fn div_assign(&mut self, rhs: Self) {
        *self *= rhs.inv();
    }
}
impl std::ops::DivAssign<i64> for Mint {
    fn div_assign(&mut self, rhs: i64) {
        *self /= Mint::new(rhs);
    }
}
impl std::ops::DivAssign<usize> for Mint {
    fn div_assign(&mut self, rhs: usize) {
        *self /= Mint::new(rhs as i64);
    }
}
impl<T> std::ops::Div<T> for Mint
where
    Mint: std::ops::DivAssign<T>,
{
    type Output = Self;
    fn div(self, other: T) -> Self {
        let mut res = self;
        res /= other;
        res
    }
}
impl std::fmt::Display for Mint {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.0)
    }
}
impl std::ops::Deref for Mint {
    type Target = i64;
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl std::ops::DerefMut for Mint {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}

fn solve() {
    let (s): usize = read();
    let mut vec = vec![Mint(0); s + 1];
    vec[0] = Mint(1);
    for i in 3..s + 1 {
        vec[i] = vec[i - 1] + vec[i - 3];
    }
    println!("{}", vec[s]);

    return;
}
fn main() {
    solve()
}


use proconio::input;

fn main() {
    input! {
        s: usize,
    }

    // if s == 2000 {
    //     println!("883312678");
    //     return;
    // }

    type Mi = ModInt<Mod1e9p7>;

    let mut dp = vec![Mi::new(0); s + 1];
    let mut res = Mi::new(0);
    dp[0] = Mi::new(1);
    for i in 0..=(s + 2) / 3 {
        let mut tmp = vec![Mi::new(0); s + 1];
        for j in 0..=s {
            for k in 3..=s {
                if j + k > s {
                    break;
                }
                tmp[j + k] += dp[j];
            }
        }
        dp = tmp;
        res += dp[s];
    }

    println!("{}", res);
}

// /////////////////////////////////////////////////////////////
use std::fmt;
use std::marker::PhantomData;
use std::ops::*;

#[derive(Clone, Copy, Eq, PartialEq, fmt::Debug)]
struct ModInt<M: Mod> {
    n: i64,
    _p: PhantomData<M>,
}

impl<M: Mod> Add<ModInt<M>> for ModInt<M> {
    type Output = Self;
    fn add(self, other: Self) -> Self::Output {
        let mut n = self.n + other.n;
        if n < 0 {
            n += M::get();
        } else if n >= M::get() {
            n -= M::get();
        }
        Self { n, _p: PhantomData }
    }
}

impl<M: Mod> AddAssign<ModInt<M>> for ModInt<M> {
    fn add_assign(&mut self, other: Self) {
        self.n += other.n;
        if self.n < 0 {
            self.n += M::get();
        } else if self.n >= M::get() {
            self.n -= M::get();
        }
    }
}

impl<M: Mod> Sub<ModInt<M>> for ModInt<M> {
    type Output = Self;
    fn sub(self, other: Self) -> Self::Output {
        let mut n = self.n - other.n;
        if n < 0 {
            n += M::get();
        } else if n >= M::get() {
            n -= M::get();
        }
        Self { n, _p: PhantomData }
    }
}

impl<M: Mod> SubAssign<ModInt<M>> for ModInt<M> {
    fn sub_assign(&mut self, other: Self) {
        self.n -= other.n;
        if self.n < 0 {
            self.n += M::get();
        } else if self.n >= M::get() {
            self.n -= M::get();
        }
    }
}

impl<M: Mod> Mul<ModInt<M>> for ModInt<M> {
    type Output = Self;
    fn mul(self, other: Self) -> Self::Output {
        let n = (self.n * other.n).rem_euclid(M::get());
        Self { n, _p: PhantomData }
    }
}

impl<M: Mod> MulAssign<ModInt<M>> for ModInt<M> {
    fn mul_assign(&mut self, other: Self) {
        self.n = (self.n * other.n).rem_euclid(M::get());
    }
}

impl<M: Mod> Div<ModInt<M>> for ModInt<M> {
    type Output = Self;
    fn div(self, other: Self) -> Self::Output {
        let n = (self.n * other.recip().unwrap().n).rem_euclid(M::get());
        Self { n, _p: PhantomData }
    }
}

impl<M: Mod> DivAssign<ModInt<M>> for ModInt<M> {
    fn div_assign(&mut self, other: Self) {
        self.n = (self.n * other.recip().unwrap().n).rem_euclid(M::get());
    }
}

impl<M: Mod> Neg for ModInt<M> {
    type Output = Self;
    fn neg(self) -> Self::Output {
        if self.n == 0 {
            Self {
                n: 0,
                _p: PhantomData,
            }
        } else {
            Self {
                n: M::get() - self.n,
                _p: PhantomData,
            }
        }
    }
}

impl<M: Mod> fmt::Display for ModInt<M> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}", self.n)
    }
}

impl<M: Mod> ModInt<M> {
    fn new(n: i64) -> Self {
        let n = n.rem_euclid(M::get());
        Self { n, _p: PhantomData }
    }

    fn get(self) -> i64 {
        self.n
    }

    fn recip(self) -> Option<Self> {
        let mut x = 0i64;
        let mut y = 1i64;
        let mut a = self.n;
        let mut b = M::get();
        let mut u = y;
        let mut v = x;
        while a != 0 {
            let q = b / a;
            let tmp = x - q * u;
            x = u;
            u = tmp;
            let tmp = y - q * v;
            y = v;
            v = tmp;
            let tmp = b - q * a;
            b = a;
            a = tmp;
        }
        if b == 1 {
            Some(Self::new(x))
        } else {
            None
        }
    }

    fn pow(self, mut n: u64) -> Self {
        let mut res = ModInt::<M>::new(1);
        let mut dbl = self.clone();
        while n > 0 {
            if n & 1 == 1 {
                res *= dbl;
            }
            dbl *= dbl;
            n >>= 1;
        }
        res
    }
}

trait Mod: Copy + Clone + fmt::Debug {
    fn get() -> i64;
}

#[derive(Copy, Clone, fmt::Debug)]
struct Mod1e9p7 {}

impl Mod for Mod1e9p7 {
    fn get() -> i64 {
        1_000_000_007
    }
}

#[derive(fmt::Debug)]
struct ModValTable<M> {
    fact: Vec<M>,
    fact_inv: Vec<M>,
    inv: Vec<M>,
}

impl<M: Mod> ModValTable<ModInt<M>> {
    fn new(n: usize) -> Self {
        let mut fact = vec![ModInt::<M>::new(1); n + 1];
        let mut fact_inv = vec![ModInt::<M>::new(1); n + 1];
        let mut inv = vec![ModInt::<M>::new(1); n + 1];
        for i in 2..=n {
            fact[i] = fact[i - 1] * ModInt::<M>::new(i as i64);
            inv[i] = -ModInt::<M>::new(M::get() / i as i64)
                * inv[M::get() as usize % i];
            fact_inv[i] = fact_inv[i - 1] * inv[i];
        }

        Self {
            fact,
            fact_inv,
            inv,
        }
    }

    fn perm(&self, n: usize, r: usize) -> ModInt<M> {
        if n < r {
            ModInt::<M>::new(0)
        } else {
            self.fact[n] * self.fact_inv[n - r]
        }
    }

    fn binom(&self, n: usize, r: usize) -> ModInt<M> {
        if n < r {
            ModInt::<M>::new(0)
        } else {
            self.fact[n] * self.fact_inv[r] * self.fact_inv[n - r]
        }
    }

    fn mulnom(&self, n: usize, r: usize) -> ModInt<M> {
        self.binom(n + r - 1, r)
    }

    fn fact(&self, n: usize) -> ModInt<M> {
        self.fact[n]
    }

    fn fact_recip(&self, n: usize) -> ModInt<M> {
        self.fact_inv[n]
    }

    fn recip(&self, n: usize) -> ModInt<M> {
        self.inv[n]
    }
}
// /////////////////////////////////////////////////////////////


// -*- coding:utf-8-unix -*-

use proconio::input;

// n^p mod m (繰り返し二乗法)
fn repeat_square(n: u64, p: u64, m: u64) -> u64 {
    if p == 0 {
        1
    } else if p == 1 {
        n % m
    } else if p % 2 == 0 {
        repeat_square(n, p / 2, m).pow(2) % m
    } else {
        (n * repeat_square(n, p - 1, m)) % m
    }
}

fn ncr_mod(n: u64, r: u64, m: u64) -> u64 {
    let mut denominator = n;
    let mut numerator = 1;
    for i in 1..r {
        denominator = (denominator * (n - i)) % m;
        numerator = (numerator * (i + 1)) % m;
    }
    (denominator * repeat_square(numerator, m - 2, m)) % m
}

fn main() {
    input! {
        s: u64,
    }

    let divisor = 10_u64.pow(9) + 7;
    let mut ans = 0;
    // 項の数が i (すべての項は 3 以上)
    for i in 1..s {
        if 3 * i > s {
            break;
        }

        let needed = s - (3 * i);
        ans += ncr_mod(i + needed - 1, needed, divisor);
        ans = ans % divisor;
    }
    println!("{}", ans);
}


let s = Int(readLine()!)!
let devider = 1000_000_000 + 7
var dpTable: [Int] = .init(repeating: 0, count: s+1)

dpTable[0] = 1
dpTable[1] = 0
dpTable[2] = 0

if s >= 3 {
    for i in 3...s {
        dpTable[i] = dpTable[i-3]+dpTable[i-1]
        dpTable[i] %= devider
    }
}

print(dpTable[s])


let s = Int(readLine()!)!

var dp: [Int] = .init(repeating: -1, count: s + 1)
let mod = 1000000007
func backtrack(from value: Int, target: Int) -> Int {
  if value == target {
    return 1
  }
  if value > target {
    return 0
  }
  if dp[value] != -1 {
    return dp[value]
  }

  var sum = 0
  for i in 3..<2001 {
    if i + value > target {
      break
    }
    sum += backtrack(from: value + i, target: target)
    sum %= mod
  }
  dp[value] = sum
  return dp[value]
}

print(backtrack(from: 0, target: s))