#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
signed main() {
  long long n;
  cin >> n;
  long long Dp[n + 1];
  Dp[0] = 1;
  Dp[1] = 0;
  for (long long i = 2; i <= n; i++)
    Dp[i] = (2 * Dp[i - 1] + 3 * Dp[i - 2]) % MOD;
  cout << Dp[n];
}
