using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

//using System.Numerics;
using CS=System.Runtime.CompilerServices;
//using System.Diagnostics;
using static System.Math;
using ll=System.Int64;
using static Contest_D.Lib_IO;
using static Contest_D.Lib_Minifunc;


namespace Contest_D {

public static class Entry
{

	public static void Main() {
		checked{
			ll s;
			Lib_IO.rm(out s);

			ModCombination mc = new ModCombination(s,MOD1);
			var dp = ModCombination.PartitionTable(s,s,MOD1);

			long ans = 0;
			for (int t = 1; t < 700; t++)
			{
				if(s-3*t<0) break;
				ans = (ans + mc.C(s-3*t+t-1,s-3*t))%MOD1;
			}



			Lib_IO.wm(ans);
		}
	}



public struct ModInt {
	public readonly long Value, Modulo;
//	public System.Numerics.BigInteger Value, Modulo;

	public ModInt(long value) : this(value, long.MaxValue) {}
	public ModInt(long value, long modulo) {
//	public ModInt(System.Numerics.BigInteger value, System.Numerics.BigInteger modulo) {
		if (modulo<2) throw new ArgumentException("Invalid modulo", "modulo");
		this.Value = value % modulo;
		if(this.Value < 0) this.Value += modulo;
		this.Modulo = modulo;
	}

	public static implicit operator long(ModInt a) => a.Value;
	public static ModInt operator-(ModInt a) => new ModInt(-1*a.Value, a.Modulo); 
	public static ModInt operator+(ModInt a, ModInt b) => new ModInt(a.Value + b.Value, a.Modulo==b.Modulo?a.Modulo:-1); 
	public static ModInt operator-(ModInt a, ModInt b) => new ModInt(a.Value - b.Value, a.Modulo==b.Modulo?a.Modulo:-1); 
	public static ModInt operator*(ModInt a, ModInt b) => new ModInt(a.Value * b.Value, a.Modulo==b.Modulo?a.Modulo:-1); 
	public static ModInt operator/(ModInt a, ModInt b) => a * b.Inv();
	public static ModInt operator+(ModInt a, long c) => new ModInt(a.Value + c, a.Modulo); 
	public static ModInt operator-(ModInt a, long c) => new ModInt(a.Value - c, a.Modulo); 
	public static ModInt operator*(ModInt a, long c) => new ModInt(a.Value * c, a.Modulo); 
	public static ModInt operator/(ModInt a, long c) => a * (new ModInt(c, a.Modulo)).Inv(); 
	public static bool operator==(ModInt a, ModInt b) => a.Equals(b);
	public static bool operator!=(ModInt a, ModInt b) => !a.Equals(b);

	public ModInt Inv() {
		long a = this.Value, b = this.Modulo, u = 1, v = 0, t, s;
//		System.Numerics.BigInteger a = this.Value, b = this.Modulo, u = 1, v = 0, t, s;
		while(b > 0) {
			t = a / b;
			s = a - t * b; a = b; b = s;
			s = u - t * v; u = v; v = s;
		}
		return new ModInt(u, this.Modulo);
	}

	public ModInt Pow(long n) {
		ModInt ret = new ModInt(1, this.Modulo);
		ModInt x = this;
		while(true) {
			if((n & 1)==1) ret *= x;
			if((n >>= 1)<=0) break;
			x *= x;
		}
		return ret;
	}

	public override bool Equals(object obj) {
		if (!(obj is ModInt)) throw new ArgumentException("Object is not ModInt type");
		return Equals((ModInt)obj);   
	}
	public bool Equals(ModInt p) {
		if (this.Modulo != p.Modulo) throw new ArgumentException("Modulo is not Equal");
		return (this.Value == p.Value);
	}
	public override int GetHashCode() => (int)(this.Value ^ this.Modulo);
	public override string ToString() => this.Value.ToString();

}


// n! nPr nCr nHr B(n,k) S{nk} P(n,k) を求める。
// ModCombinationは結果をmod	 ※ ModInt クラスが必要
// ベル数 B(n,k)
//   区別できる n個のボールを区別できない k個以下の箱に分割する方法の数を与える。
//   特に B(n,n)は n 個のボールを任意個のグループに分割する方法の数である。
// 第2種スターリング数 S{nk}
//   区別できる n 個のボールを区別できない k 個の箱に分割する方法の数を与える。
// 分割数テーブル
//   分割数 P(n,k) は整数 n をちょうど k 個の非負整数の和で表す方法の数を与える。
//   順序が異なるものは同一視する。
// 攪乱順列（モンモール数）
//   数字の並びを完全にかくらんする（もとと同じ場所になる要素がない）順列
public class ModCombination {
	private ModInt[] _fact, _rfact, _inv, _seq;

	public ModCombination(long sz) : this(sz, long.MaxValue) {}
	public ModCombination(long sz, long modulo){
		_fact = new ModInt[sz+1];
		_rfact = new ModInt[sz+1];
		_inv = new ModInt[sz+1];
		_seq = new ModInt[sz+1];

		for(int i = 0; i <= sz; i++) _seq[i] = new ModInt(i,modulo);
		_fact[0] = _rfact[sz] = _inv[0] = _seq[1];
		for(int i = 1; i <= sz; i++) _fact[i] = _fact[i - 1] * i;
		_rfact[sz] /= _fact[sz];
		for(int i = (int)sz - 1; i >= 0; i--) _rfact[i] = _rfact[i + 1] * (i + 1);
		for(int i = 1; i <= sz; i++) _inv[i] = _rfact[i] * _fact[i - 1];
	}

	public ModInt Fact(long n) {
		if(n < 2) return _seq[1];
		return _fact[n];
	}
	public ModInt P(long n, long k) {
		if(k < 0 || n < k) return _seq[0];
		return _fact[n] * _rfact[n - k];
	}
	public ModInt C(long n, long k) {
		if(k < 0 || n < k) return _seq[0];
		return _fact[n] * _rfact[k] * _rfact[n - k];
	}
	public ModInt H(long n, long k) {
		if(n < 0 || k < 0) return _seq[0];
		return k == 0 ? _seq[1] : C(n + k - 1, k);
	}
	public ModInt B(long n, long k) {
		if(n == 0) return _seq[1];
		k = k<n ? k : n;
		ModInt ret = _seq[0];
		ModInt[] pref = new ModInt[k + 1];
		pref[0] = _seq[1];
		for(int i = 1; i <= k; i++) {
			if((i & 1)==1) pref[i] = pref[i - 1] - _rfact[i];
			else pref[i] = pref[i - 1] + _rfact[i];
		}
		for(int i = 1; i <= k; i++) ret += _seq[i].Pow(n) * _rfact[i] * pref[k - i];
		return ret;
	}
	public ModInt S(long n, long k) {
		if (n < 0 || k < 0 || n < k) return _seq[0];
		ModInt ret = _seq[0];
		for(int i = 0; i <= k; i++) {
			ModInt add = _seq[i].Pow(n) * this.C(k, i);
			if(((k - i) & 1)==1) ret -= add;
			else ret += add;
		}
		return ret * _rfact[k];
	}
	public static ModInt[][] PartitionTable(long n, long k, long modulo=long.MaxValue) {
		ModInt[][] dp = new ModInt[n + 1][];
		for(int i=0;i<=n;i++) dp[i] = Enumerable.Repeat(new ModInt(0,modulo), (int)k+1).ToArray();
		dp[0][0] = new ModInt(1, modulo);
		for(int i = 0; i <= n; i++) {
			for(int j = 1; j <= k; j++) {
				if(i - j >= 0) dp[i][j] = dp[i][j - 1] + dp[i - j][j];
				else dp[i][j] = dp[i][j - 1];
			}
		}
		return dp;
	}
	public static long MontmortNumber(long n, long modulo=long.MaxValue) {
		if(n<=3) return Math.Max(0,n-1);
		else{
			long a1 = 1, a2 = 2, a3 = 0;
			for (long i = 4; i <= n; i++) {
				a3 = ((i-1)*(a2+a1))%modulo;
				a1 = a2;
				a2 = a3; 
			}
			return a3;
		}
	}


}













}



#region BaseModule


public static class Lib_Minifunc{
	public const long MOD1 = 1000000007; // 10^9+7
	public const double EPS1 = 1e-8;
	public const long INF1 = 1000000000000000;  // 10^15
	[CS.MethodImpl(256)] public static void swap1<T>(ref T a,ref T b) { T t = a; a = b; b = t; }
	[CS.MethodImpl(256)] public static void swap2<T>(ref T a,ref T b) where T : IComparable { if (a.CompareTo(b)==1) swap1(ref a, ref b); }  // b の方が小さければ交換

	[CS.MethodImpl(256)] public static bool chmin<T>(ref T a,T b) where T : IComparable { bool r; if (r = (a.CompareTo(b)== 1)) a = b; return r; }  // b の方が小さければ a を更新
	[CS.MethodImpl(256)] public static bool chmax<T>(ref T a,T b) where T : IComparable { bool r; if (r = (a.CompareTo(b)==-1)) a = b; return r; }  // b の方が大きければ a を更新
	[CS.MethodImpl(256)] public static bool inside(long i,long n) => (0<=i&&i<n);
	[CS.MethodImpl(256)] public static bool inside(long x,long y,long w,long h) => (inside(x,w)&&inside(y,h));
	[CS.MethodImpl(256)] public static T min<T>(params T[] a) where T : IComparable { T m = a[0]; for (int i=1;i<a.Length;i++) chmin(ref m, a[i]); return m; }
	[CS.MethodImpl(256)] public static T max<T>(params T[] a) where T : IComparable { T m = a[0]; for (int i=1;i<a.Length;i++) chmax(ref m, a[i]); return m; }
	[CS.MethodImpl(256)] public static long mod(long a,long m=MOD1) { var v = a%m; return (v<0?(m<0?v-m:v+m):v); }
	[CS.MethodImpl(256)] public static long ceil(long a,long b) => (a%b==0||(a<0&&0<b)||(0<a&&b<0)?a/b:a/b+1);	// 整数商の切り上げ
	[CS.MethodImpl(256)] public static long round(double a) => Convert.ToInt64(a);	// 四捨五入
	public static string YES(bool a) => a?"YES":"NO";
	public static string yes(bool a) => a?"Yes":"No";
	[CS.MethodImpl(256)] public static P<T,U> initp<T,U>(T a,U b) => new P<T,U>(a,b);
	[CS.MethodImpl(256)] public static P<T,U,V> initp<T,U,V>(T a,U b,V c) => new P<T,U,V>(a,b,c);
	[CS.MethodImpl(256)] public static P<T,U,V,W> initp<T,U,V,W>(T a,U b,V c,W d) => new P<T,U,V,W>(a,b,c,d);
	public static T[] initc<T>(long l1) where T : new() { var m = new T[l1]; for (int i=0;i<m.Length;i++) m[i] = new T(); return m; }	// new制約は遅い
	public static int[] range(long s, long c) => Enumerable.Range((int)s,(int)c).ToArray();
	[CS.MethodImpl(256)] public static T[] inita<T>(long l1,T v=default(T)) => Enumerable.Repeat(v,(int)l1).ToArray();
	public static T[][] inita<T>(long l1,long l2,T v=default(T)) { var m = new T[l1][]; for (int i=0;i<m.Length;i++) m[i] = inita(l2,v); return m; }
	public static void shift(this IList<int> l,int o) { for (int i = 0;i<l.Count;i++) l[i]+=o; }
	public static void shift(this IList<long> l,long o) { for (int i = 0;i<l.Count;i++) l[i]+=o; }
	[CS.MethodImpl(256)] public static bool initd<T,U>(this IDictionary<T,U> d, T k, U v=default(U)) { if(d.ContainsKey(k)) { return false; } else { d[k] = v; return true; } }
	public static void sort<T>(this T[] a,int o=1, Comparison<T> f=null) where T : IComparable {
		switch(o){
			case  0: Array.Sort(a,f);break;
			case  1: Array.Sort(a,(x,y)=>x.CompareTo(y));break;
			case -1: Array.Sort(a,(x,y)=>y.CompareTo(x));break;
			default: break;
		}
	}
	public static void sort<T,U>(this P<T,U>[] a,int o, Comparison<P<T,U>> f=null) where T : IComparable where U : IComparable {
		switch(o){
			case  0: Array.Sort(a,f);break;
			case  1: Array.Sort(a,(x,y)=>x.A.CompareTo(y.A));break;
			case -1: Array.Sort(a,(x,y)=>y.A.CompareTo(x.A));break;
			case  2: Array.Sort(a,(x,y)=>x.B.CompareTo(y.B));break;
			case -2: Array.Sort(a,(x,y)=>y.B.CompareTo(x.B));break;
			default: break;
		}
	}
	public static void sort<T,U,V>(this P<T,U,V>[] a,int o, Comparison<P<T,U,V>> f=null) where T : IComparable where U : IComparable where V : IComparable {
		switch(o){
			case  0: Array.Sort(a,f);break;
			case  1: Array.Sort(a,(x,y)=>x.A.CompareTo(y.A));break;
			case -1: Array.Sort(a,(x,y)=>y.A.CompareTo(x.A));break;
			case  2: Array.Sort(a,(x,y)=>x.B.CompareTo(y.B));break;
			case -2: Array.Sort(a,(x,y)=>y.B.CompareTo(x.B));break;
			case  3: Array.Sort(a,(x,y)=>x.C.CompareTo(y.C));break;
			case -3: Array.Sort(a,(x,y)=>y.C.CompareTo(x.C));break;
			default: break;
		}
	}
	public static void sort<T,U,V,W>(this P<T,U,V,W>[] a,int o, Comparison<P<T,U,V,W>> f=null) where T : IComparable where U : IComparable where V : IComparable where W : IComparable {
		switch(o){
			case  0: Array.Sort(a,f);break;
			case  1: Array.Sort(a,(x,y)=>x.A.CompareTo(y.A));break;
			case -1: Array.Sort(a,(x,y)=>y.A.CompareTo(x.A));break;
			case  2: Array.Sort(a,(x,y)=>x.B.CompareTo(y.B));break;
			case -2: Array.Sort(a,(x,y)=>y.B.CompareTo(x.B));break;
			case  3: Array.Sort(a,(x,y)=>x.C.CompareTo(y.C));break;
			case -3: Array.Sort(a,(x,y)=>y.C.CompareTo(x.C));break;
			case  4: Array.Sort(a,(x,y)=>x.D.CompareTo(y.D));break;
			case -4: Array.Sort(a,(x,y)=>y.D.CompareTo(x.D));break;
			default: break;
		}
	}
}


public struct P<T,U>
{
	public T A; public U B;
	public P(T a,U b) { A = a; B = b; }
	public static implicit operator KeyValuePair<T,U>(P<T,U> a) => new KeyValuePair<T,U>(a.A,a.B);
	public static implicit operator P<T,U>(KeyValuePair<T,U> a) => new P<T,U>(a.Key,a.Value);
}
public struct P<T,U,V>
{
	public T A; public U B; public V C;
	public P(T a,U b,V c) { A = a; B = b; C = c; }
}
public struct P<T,U,V,W>
{
	public T A; public U B; public V C; public W D;
	public P(T a,U b,V c,W d) { A = a; B = b; C = c; D = d; }
}

public static class Lib_IO
{
	class Prt : System.IO.StreamWriter
	{
		public override IFormatProvider FormatProvider { get { return System.Globalization.CultureInfo.InvariantCulture; } }
		public Prt(System.IO.Stream s) : base(s,new UTF8Encoding(false,true)) {}
		public Prt(System.IO.Stream s,Encoding e) : base(s,e) {}
	}
	static Prt sw = new Prt(Console.OpenStandardOutput());
	static char[] sp = new char[] {' '};
	[CS.MethodImpl(256)] static bool eq<T,U>() => typeof(T).Equals(typeof(U));
	[CS.MethodImpl(256)] static T ct<T,U>(U a) => (T)Convert.ChangeType(a,typeof(T));
	[CS.MethodImpl(256)] static T cv<T>(string s) =>
		eq<T,int>()	? ct<T,int>(int.Parse(s))
	  : eq<T,long>()   ? ct<T,long>(long.Parse(s))
	  : eq<T,double>() ? ct<T,double>(double.Parse(s,System.Globalization.CultureInfo.InvariantCulture))
	  : eq<T,char>()   ? ct<T,char>(s[0])
					   : ct<T,string>(s);
	public static string[] rm<T>(out T a) {
		var z = Console.ReadLine().Split(sp,StringSplitOptions.RemoveEmptyEntries); 
		a = cv<T>(z[0]);
		return z;
	}
	public static string[] rm<T,U>(out T a,out U b) {
		var z = rm<T>(out a); 
		b = cv<U>(z[1]);
		return z;
	}
	public static string[] rm<T,U,V>(out T a,out U b,out V c) {
		var z = rm<T,U>(out a,out b); 
		c = cv<V>(z[2]);
		return z;
	}
	public static string[] rm<T,U,V,W>(out T a,out U b,out V c,out W d) {
		var z = rm<T,U,V>(out a,out b,out c); 
		d = cv<W>(z[3]);
		return z;
	}
	public static string[] rm<T,U,V,W,X>(out T a,out U b,out V c,out W d,out X e) {
		var z = rm<T,U,V,W>(out a,out b,out c,out d); 
		e = cv<X>(z[4]);
		return z;
	}
	public static string[] rm<T,U,V,W,X,Y>(out T a,out U b,out V c,out W d,out X e,out Y f) {
		var z = rm<T,U,V,W,X>(out a,out b,out c,out d,out e); 
		f = cv<Y>(z[5]);
		return z;
	}
	public static string[] ra<T>(out T[] a) {		
		var z = Console.ReadLine().Split(sp,StringSplitOptions.RemoveEmptyEntries);
		a = new T[z.Length];
		for(int i=0;i<a.Length;i++) a[i] = cv<T>(z[i]);
		return z;
	}
	public static string[][] rl<T>(long n,out T[] a) {
		a = new T[n];
		var y = new string[n][];
		for(int i=0;i<n;i++) y[i] = rm(out a[i]);
		return y;
	}
	public static string[][] rl<T,U>(long n,out P<T,U>[] a) {
		a = new P<T,U>[n];
		var y = new string[n][];
		for(int i=0;i<n;i++) {
			T o; U p;
			y[i] = rm(out o,out p);
			a[i] = new P<T,U>(o,p);
		}
		return y;
	}
	public static string[][] rl<T,U,V>(long n,out P<T,U,V>[] a) {
		a = new P<T,U,V>[n];
		var y = new string[n][];
		for(int i=0;i<n;i++) {
			T o; U p; V q;
			y[i] = rm(out o,out p,out q);
			a[i] = new P<T,U,V>(o,p,q);
		}
		return y;
	}
	public static string[][] rl<T,U,V,W>(long n,out P<T,U,V,W>[] a) {
		a = new P<T,U,V,W>[n];
		var y = new string[n][];
		for(int i=0;i<n;i++) {
			T o; U p; V q; W r;
			y[i] = rm(out o,out p,out q,out r);
			a[i] = new P<T,U,V,W>(o,p,q,r);
		}
		return y;
	}
	public static string[][] rx<T>(long n,out T[][] a) {
		a = new T[n][];
		var y = new string[n][];
		for(int i=0;i<n;i++) y[i] = ra(out a[i]);
		return y;
	}

	static void wwp(Action act){
		sw.AutoFlush = false;
		Console.SetOut(sw);
		act();
		Console.Out.Flush();
		sw.AutoFlush = true;
		Console.SetOut(sw);
	}
	[CS.MethodImpl(256)] static string wfm(Type t) =>t.Equals(typeof(double)) ? "{0:F10}" : "{0}";
	public static void wm(params object[] a) {
		wwp(()=>{
			for(int i=0;i<a.Length-1;i++) Console.Write(wfm(a[i].GetType())+" ",a[i]);
			Console.WriteLine(wfm(a[a.Length-1].GetType()),a[a.Length-1]);
		});
	}
	public static void wa<T>(IList<T> a) { wxa(new IList<T>[]{a}, " "); }
	public static void wl<T>(IList<T> a) {
		wwp(()=>{
			var f = wfm(typeof(T));
			if(a.Count==0){
				Console.WriteLine();
			}else{
				foreach(T x in a) Console.WriteLine(f,x);
			}
		});
	}
	static void wxa<T>(IList<IList<T>> a, string s) {
		wwp(()=>{
			var f = wfm(typeof(T));
			var g = f + s;
			foreach(var b in a) {
				if(b.Count==0){
					Console.WriteLine();
				}else{
					for(int i=0;i<b.Count-1;i++) Console.Write(g,b[i]);
					Console.WriteLine(f,b[b.Count-1]);
				}
			}
		});
	}
	public static void wx<T>(IList<IList<T>> a) { wxa(a, " "); }
	public static void wg<T>(IList<IList<T>> a) { wxa(a, ""); }
}

#endregion



}

Measured memory_bytes: 91532