#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ksm(ll a,ll b)
{
    ll ans=1;
    while(b)
	{
        if(b%2==1)//!b&1
			ans*=a;
        b/=2;//b>>=1
        a*=a;
    }
    return ans;
  
}
int main()
{
    ll n,m;
    cin>>n>>m;
    cout<<ksm(n,m)<<endl;
}


// for instance:
		求pow(2,10):

// 指数是偶数,pow(2,10) = pow(4,5)
// 指数是奇数,pow(4,5) = 4 * pow(4,4)
// 指数是偶数, 4 * pow(4,4) = 4 * pow(16,2)
// 指数是偶数,4 * pow(16,2) = 4 * pow(256,1)
// 指数是奇数, 4 * pow(256,1)=4 * 256 * pow(256,0)
// 指数为0时停止,ans即计算 4 * 256 = 1024
        
        
        
     //    while(b){//当指数不为0时执行
  //        if(b%2==0){//指数为偶数时,指数/2,底数*2
    //          b/=2;
      //        a*=a; 
        //  }else{//指数为奇数时,分离指数,ans*底数
          //    ans*=a; 
            //  b--;
          //}
     // } 
  //return ans;