d[3000][40];y,n,i,j,k,s,m=1e9+7;long long p(a,n){return n?a*p(a,n-1)%m:1;}main(t){for(scanf("%*d%d",&n);~scanf("%d",&s);s>1?d[i][0]=s,d[i++][2]=1:0,s=1)for(k=2;s%k<1?s/=k,++t:t>1&&(j=d[++y][0])!=k?!j?d[y--][0]=k:1:(d[y][t]++,k++,t=1,y=0,s>=k*k)?:d[++i][0];);for(;--i||!printf("%d",s);s=s*p(d[i][0],k)%m)for(k=t=0,j=30;tn?y-t+n:y))t+=y=d[i][j];}