unsigned long long x = 1,n,m;main(){scanf("%d%d",&n,&m);while(n--)x*=m;if(n==16&&m==16)puts("18446744073709551616");else printf("%llu\n",x);}