#include using namespace std; int n; int main() { cin >> n; cout << (int)((__int128)n * n * n % 1000000007) << endl; return 0; }