import sys input = lambda : sys.stdin.readline().rstrip() write = lambda x: sys.stdout.write(x+"\n") debug = lambda x: sys.stderr.write(x+"\n") writef = lambda x: print("{:.12f}".format(x)) n = int(input()) l = [ [[0,0,0], [-1, 1, 0]], [[1,1,0], [0,-1,1]] ] dp = {} M = 10**9+7 def sub(y, v1, v3, v4): if y==0: return v1 and v3 and v4 elif y<0: return 0 if (y,v1,v3,v4) in dp: return dp[y,v1,v3,v4] res = 0 for i in range(2): for j in range(2): ll = l[i][j] nv1 = v1 + ll[0] nv3 = v3 + ll[1] nv4 = v4 + ll[2] nv1 = max(0, min(1, nv1)) nv3 = max(0, min(1, nv3)) nv4 = max(0, min(1, nv4)) res += sub((y-j)//2, nv1, nv3, nv4) dp[y,v1,v3,v4] = res%M return res%M ans = sub(n, 1, 0, 0) print(ans%M)