#include using namespace std; typedef long long ll; int main() { ll n,m=1000000007,x=1; cin >> n; x*=n;x%=m; x*=n;x%=m; x*=n;x%=m; cout << x << endl; return 0; }