#include <bits/stdc++.h>
using namespace std;
long long int n;
const long long int mod = 1000000007;
long long int f(long long int x, long long int k) {
  long long int res = 1;
  while (k) {
    if (k & 1) res = res * x % mod;
    x = x * x % mod;
    k >>= 1;
  }
  return res;
}
int main() {
  cin >> n;
  n++;
  if (n == 1)
    cout << "1";
  else {
    long long int a = f(4, n - 2);
    long long int b = f(2, n - 2);
    a = a * 2 % mod;
    cout << (a + b) % mod;
  }
  return 0;
}
