#include<iostream>
#include<cstdio>
#include<algorithm>
typedef long long LL;
const int N=1e6+5, M=1e9+7;
int f[N] = {0, 1, 2, 4, 8, 16, 32}, sum[N];
inline int Add(const int& a, const int& b)
{
return (a+b)%M;
} //add big num with mod
void Test()
{
freopen("temp\\in.txt", "r", stdin);
}
int main()
{
// Test();
int n;
scanf("%d", &n);
for(int i=1; i<=6; i++)
sum[i] = Add(sum[i-1], f[i]);
for(int i=7; i<=n; i++)
{
f[i] = sum[i-1] - sum[i-7];
if(f[i] < 0) f[i] += M;
sum[i] = Add(sum[i-1], f[i]);
}
printf("%d", f[n]);
return 0;
}