N = int(input()) m = 1000000007 t = [0] * (N + 1 + 6) t[0] = 1 n = pow(6, m - 2, m) t[1] = t[0] * n t[1] %= m t[2] = (t[0] + t[1]) * n t[2] %= m t[3] = (t[0] + t[1] + t[2]) * n t[3] %= m t[4] = (t[0] + t[1] + t[2] + t[3]) * n t[4] %= m t[5] = (t[0] + t[1] + t[2] + t[3] + t[4]) * n t[5] %= m t[6] = (t[0] + t[1] + t[2] + t[3] + t[4] + t[5]) * n t[6] %= m for i in range(7, N + 1): for j in range(1, 7): t[i] += t[i - j] * n t[i] %= m print(t[N])