import sys input = sys.stdin.readline N=int(input()) mod=10**9+7 if N==1: print(2) exit() if N%2==1: N-=1 ANS=3 else: ANS=1 ANS*=4 N-=2 ANS*=pow(5,N//2,mod) print(ANS%mod)