import std.container;
import std.range;
import std.algorithm;
import std.array;
import std.string;
import std.conv;
import std.stdio;
import std.container;

void main() {
	enum long Mod = 10 ^^ 9 + 7;

	ulong s;
	readf("%s\n", &s);

	auto dp = new long[s + 1];
	dp[0] = 1;

	foreach (i;3..s + 1) {
		dp[i] = (dp[i - 1] + dp[i - 3]) % Mod;
	}

	writeln(dp[s]);
}
