#include using namespace std; #define REP(i, n) for(int (i) = 0; (i) < (n); (i)++) #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) typedef long long ll; const ll MOD = 1e9+7; int main(void){ ll n; cin >> n; ll m = n-4; ll q = m/6, r = m%6; ll ans = 1; if(!r){ ans *= (3*q)%MOD; ans *= (q+1)%MOD; ans %= MOD; ans++; }else{ ans *= (3*q+r)%MOD; ans *= (q+1)%MOD; ans %= MOD; } cout << ans << endl; return 0; }