MOD = 10**9 + 7 n = int(input()) result = pow(n, 3, MOD) print(result)