#include #define endl '\n' using namespace std; typedef long long ll; const ll mod = 1e9+7; ll solve(ll n) { ll ans = 1; ll base = 2; while(n > 0) { if(n % 2 == 1) ans = (ans * base) % mod; base = (base * base) % mod; n /= 2; } return ans; } int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll n; cin >> n; cout << solve(n - 1) << endl; return 0; }