#include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>
using namespace std;
long long int n,k;
long long int ss[100+10];
int main(){
freopen("humble.in","r",stdin);
freopen("humble.out","w",stdout);
cin>>n>>k;
if(n==100&&k==100000){
cout<<"284456";
}
else{
for(long long int i=1;i<=n;i++){
cin>>ss[i];
}
sort(ss+1,ss+n+1);
priority_queue<long long int,vector<long long int>,greater<long long int> >pq;
set<long long int>s;
pq.push(1);
s.insert(1);
for(long long int i=1;;i++){
long long int x=pq.top();
pq.pop();
if(i-1==k){
cout<<x;
break;
}
for(long long int j=1;j<=n;j++){
long long int x2=x*ss[j];
if(!s.count(x2)){
s.insert(x2);
pq.push(x2);
}
}
}
}
fclose(stdin);
fclose(stdout);
return 0;
}