#include using namespace std; #define MOD 1000000007 #define int long long int pow_mod(int n, int m){ int ans = 1; while(m != 0){ if(m & 1) ans = ans * n % MOD; n = n * n % MOD; m >>= 1; } return ans; } int combi(int n, int r){ int a1, a2; n %= MOD; a1 = a2 = 1; for(int i = 0;i < r;i++){ a1 = (a1 * (n-i)) % MOD; a2 = (a2 * (r-i)) % MOD; } return a1 * pow_mod(a2, MOD-2) % MOD; } signed main(){ int n; cin >> n; int ans = combi(n-4+2, 2); int a2, a3; a3 = (n-4) % 3 == 0 ? 1 : 0; a2 = ((n-4) / 2) % MOD * 3; a2 %= MOD; //if((n-4) % 6 == 0 && n != 4) a2--; ans -= a2 + a3; if(ans < 0) ans = MOD-ans; ans *= pow_mod(3*2, MOD-2); ans %= MOD; ans += ((n-4) / 2) % MOD; ans += 1; ans %= MOD; cout << ans << endl; return 0; }