#include #include #include using namespace std; using ll = long long; const ll mod = 1000000007; ll modpow(ll b, ll e){ ll ans = 1; for(; e; b = b*b % mod, e/= 2){ if(e&1) ans = ans*b%mod; } return ans; } int main() { ll n; cin >> n; cout << n* modpow(2, n-3) % mod << endl; }