#include <stdio.h>
int p[26]={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 fct[101][26];
int np=25,n,k;
int M[26];
int R[1000];
void add1(int A[],int B[])
{
int i;
for (i=0; i<25; i++)
A[i]+=B[i];
}
void addf(int A[],int x)
{
int i;
for (i=0; i<25 && p[i]<=x; i++)
while (x%p[i]==0)
{
x/=p[i]; A[i]++;
}
}
void mul(int A[], int B)
{
int i, t = 0;
for (i = 1; i <= A[0] || t; i++, t /= 10)
A[i] = (t += A[i] * B) % 10;
A[0] = i - 1;
}
int main()
{
FILE *in = fopen("factoriale.in","r");
FILE *out = fopen("factoriale.out","w");
int i,j,x,t;
fct[2][0]=1;
for (i=3; i<101; i++)
{
add1(fct[i],fct[i-1]);
addf(fct[i],i);
}
fscanf(in,"%d%d",&n,&k);
for (i=0; i<n; i++)
{
fscanf(in,"%d",&x);
add1(M,fct[x]);
}
R[0]=1; R[1]=1;
for (i=0; i<25; i++)
{
t=M[i]%k;
if (t!=0)
t=k-t;
for (j=0; j<t; j++)
mul(R,p[i]);
}
for (i=R[0]; i>0; i--)
fprintf(out,"%d",R[i]);
fprintf(out,"\n");
return 0;
}