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