N = int(input()) print(N ** 3 % 1000000007)