#include<stdio.h>
int c[101];
int main()
{
freopen("factoriale.in","r",stdin);
freopen("factoriale.out","w",stdout);
int p[25]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
int n,k,x,i,j,t,w,xmax=0;
long long r=1;
scanf("%d%d",&n,&k);
for(i=0; i<n; i++)
{
scanf("%d",&x);
if(x>xmax)
xmax=x;
for(j=2; j<=x; j++)
{
w=j;
for(t=0; (t<25)&&(w!=1); t++)
{
while(w%p[t]==0)
{
w=w/p[t];
c[p[t]]++;
}
}
}
}
for(i=2; i<=xmax; i++)
{
if(c[i])
{
if(c[i]%k!=0)
{
for(j=k-c[i]%k; j>0; j--)
r*=i;
}
}
}
printf("%lld\n",r);
return 0;
}