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