#include using namespace std; using ll = long long; using vll = vector; #define sz(x) ((ll)(x).size()) const ll MOD = 1e9+7; int main() { ll N; cin >> N; ll res = N; for (ll i = 0; i < N - 3; ++i) { res = (res * 2) % MOD; } cout << res << endl; }