using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using static System.Math;

namespace CSharpSpiral {
	class Program {
		public static void Main(string[] args) {
			var sw = new StreamWriter(Console.OpenStandardOutput()) {
				AutoFlush =
#if DEBUG
			true
#else
			false
#endif
			};
			Console.SetOut(sw);
			new Program().Solve(new ConsoleInput(
#if DEBUG
			new StreamReader("../../../inputData.txt")
#else
			Console.In
#endif
			, ' '));
			Console.Out.Flush();
		}

		public void Solve(ConsoleInput cin) {
			var F = new ResidueField();
			var S = cin.ReadInt;
			var D = Enumerable.Range(0, S / 3 + 1).Select(i => F.Combination(S - 2 * i - 1, i-1));
			var res = 0L;
			foreach(var d in D) {
				res += d;
				res %= 1_000_000_007;
			}
			Console.WriteLine(res);
		}
	}

	class ResidueField: QuotientRing {
		public ResidueField(int _modulo = 1000 * 1000 * 1000 + 7) : base(_modulo) { }
		private static long extgcd(long a, long b, ref long x, ref long y) {
			if(b == 0) {
				x = 1; y = 0; return a;
			}
			var q = a / b;
			var g = extgcd(b, a - q * b, ref x, ref y);
			var z = x - q * y;
			x = y; y = z;
			return g;
		}
		public long Inv(long a) {
			if(a == 0) throw new DivideByZeroException();
			long x = 0, y = 0;
			extgcd(a, modulo, ref x, ref y);
			return mod(x);
		}
		public long Div(long a, long b) => Mul(a, Inv(b));
		public override long Permutation(int n, int k) {
			if(n > 2000000 && factorialTableLastIndex < 2000000) return base.Permutation(n, k);
			return Div(Factorial(n), Factorial(n - k));
		}
		public long Combination(int n, int k) {
			if(k < 0 || k > n) return 0;
			if(n - k < k) k = n - k;
			return Div(Permutation(n, k), Factorial(k));
		}
		public override long Calculate(params object[] RPN) {
			var S = new Stack<long>();
			foreach(var token in RPN) {
				var type = token.GetType();
				if(type == typeof(int)) {
					S.Push((int)token);
				} else if(type == typeof(long)) {
					S.Push((long)token);
				} else if(type == typeof(char)) {
					long v1 = 0L, v2 = 0L;
					v2 = S.Pop();
					HashSet<char> unaries = new HashSet<char>() { '!' };
					if(!unaries.Contains((char)token))
						v1 = S.Pop();
					var res = ((char)token) switch
					{
						'+' => Add(v1, v2),
						'-' => Sub(v1, v2),
						'*' => Mul(v1, v2),
						'/' => Div(v1, v2),
						'^' => Pow(v1, v2),
						'!' => Factorial((int)v2),
						'C' => Combination((int)v1, (int)v2),
						'P' => Permutation((int)v1, (int)v2),
						_ => throw new InvalidOperationException(),
					};
					S.Push(res);
				} else throw new InvalidOperationException();
			}
			return S.Peek();
		}
		public long Sqrt(long x) {
			if(Pow(x, (modulo - 1) / 2) != 1)
				throw new InvalidOperationException("Not a square number");
			int s = 0, t = (int)modulo - 1;
			while((t & 1) == 0) {
				s += 1;
				t /= 2;
			}
			int b = 2;
			for(int bb = 0; bb < modulo; bb++) {
				if(Pow(bb, (modulo - 1) / 2) != 1) {
					b = bb; break;
				}
			}
			var c = Pow(b, t);
			var x1 = Inv(x);
			var r = Pow(x, (t + 1) / 2);
			for(int i = 1; i < s; i++) {
				var d = Mul(Pow(r, 2), x1);
				for(int si = 0; si < s - i - 1; si++) {
					d = Mul(d, d);
				}
				if(d == 1) break;
				r = Mul(r, c);
				c = Mul(c, c);
			}
			return r < 0 ? -r : r;
		}
	}
	class QuotientRing {
		public readonly long modulo;
		public QuotientRing(int mModulo = 1000 * 1000 * 1000 + 7) {
			modulo = mModulo;
		}
		private long[] factorialTable = { 1 };
		protected int factorialTableLastIndex { get { return factorialTable.Length - 1; } }
		public long mod(long x) => x < 0 ? x % modulo + modulo : x % modulo;
		public long Add(long a, long b) => mod(a + b);
		public long Sub(long a, long b) => mod(a - b);
		public long Mul(long a, long b) => mod(a * b);
		public long Pow(long a, long n) {
			if(n == 0) return 1;
			var R = 1L;
			n = n < 0 ? n % (modulo - 1) + (modulo - 1) : n % (modulo - 1);
			for(; n > 0; a = Mul(a, a), n >>= 1) {
				if((n & 1) != 0) R = Mul(R, a);
			}
			return R;
		}
		private void ExpandFactorialTable(int N) {
			var k = factorialTableLastIndex;
			Array.Resize(ref factorialTable, N + 1);
			for(int i = k + 1; i <= N; i++) {
				if(i == 0) { factorialTable[i] = 1; continue; }
				factorialTable[i] = Mul(factorialTable[i - 1], i);
			}
		}
		public long Factorial(int n) {
			if(n > factorialTableLastIndex)
				ExpandFactorialTable(n);
			return factorialTable[n];
		}
		public virtual long Permutation(int n, int k) {
			if(k < 0 || k > n) return 0;
			var Res = 1L;
			for(int i = 0; i < k; i++)
				Res = Mul(Res, n - i);
			return Res;
		}
		public virtual long Calculate(params object[] RPN) {
			var S = new Stack<long>();
			foreach(var token in RPN) {
				var type = token.GetType();
				if(type == typeof(int)) {
					S.Push((int)token);
				}else if(type == typeof(long)) {
					S.Push((long)token);
				} else if(type == typeof(char)) {
					long v1 = 0L, v2 = 0L;
					v2 = S.Pop();
					HashSet<char> unaries = new HashSet<char>() { '!' };
					if(!unaries.Contains((char)token))
						v1 = S.Pop();
					var res = ((char)token) switch
					{
						'+' => Add(v1, v2),
						'-' => Sub(v1, v2),
						'*' => Mul(v1, v2),
						'^' => Pow(v1, v2),
						'!' => Factorial((int)v2),
						_ => throw new InvalidOperationException(),
					};
					S.Push(res);
				} else throw new InvalidOperationException();
			}
			return S.Peek();
		}
	}

	static class ExtendClass {
		public static string Join<T>(this IEnumerable<T> X, string separator = " ")
			=> string.Join(separator, X);
	}
	class ConsoleInput {
		private readonly TextReader _stream;
		private readonly char _separator = ' ';
		private readonly Queue<string> inputStream;
		public ConsoleInput(TextReader stream, char separator = ' ') {
			this._separator = separator;
			this._stream = stream;
			inputStream = new Queue<string>();
		}
		public string Read {
			get {
				if(inputStream.Count != 0) return inputStream.Dequeue();
				string[] tmp = _stream.ReadLine().Split(_separator);
				for(int i = 0; i < tmp.Length; ++i)
					inputStream.Enqueue(tmp[i]);
				return inputStream.Dequeue();
			}
		}
		public string ReadLine { get { return _stream.ReadLine(); } }
		public int ReadInt { get { return int.Parse(Read); } }
		public long ReadLong { get { return long.Parse(Read); } }
		public double ReadDouble { get { return double.Parse(Read); } }
		public string[] ReadStrArray(long N) {
			var ret = new string[N];
			for(long i = 0; i < N; ++i)
				ret[i] = Read;
			return ret;
		}
		public int[] ReadIntArray(long N) { var ret = new int[N]; for(long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
		public long[] ReadLongArray(long N) { var ret = new long[N]; for(long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
		public double[] ReadDoubleArray(long N) { var ret = new double[N]; for(long i = 0; i < N; ++i) ret[i] = ReadDouble; return ret; }
		public bool isEOF {
			get { return _stream.Peek() == -1; }
		}
	}

}


Measured memory_bytes: 28428