N = int(input()) mod = 10 ** 9 + 7 ans = 1 for i in range(1, N + 1): ans *= i * i * (2 * i - 1) ans %= mod print(ans)