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