#include using namespace std; using ll = long long; int main() { ll res, n, mod = 1000000007; cin >> n; res = n; if (n == 2) { cout << 1 << endl; return 0; } for (ll i = 0; i < n - 3; ++i) { res <<= 1; res %= mod; } cout << res << endl; return 0; }