N = int(input()) MOD = 1000000007 a = [0] * (N+10) a[1] = 1 even = 0 odd = 1 for i in range(2, N+1): if i % 2 == 0: a[i] = N * odd % MOD even = (even + a[i]) % MOD else: a[i] = N * even % MOD odd = (odd + a[i]) % MOD print(a[N])