include[HTML_REMOVED]
using namespace std;
const int N=1e6+10;
int q[N];
int quick_sort(int l,int r,int k)
{
if(l>=r)return q[l] ;
int x=q[l], i=l-1,j=r+1;
while(i<j)
{
do i++;while (q[i]<x);
do j--; while (q[j]>x);
if(j>i) swap(q[i],q[j]);
}
int s=j-l+1;
if(s>=k)
return quick_sort( l,j,k);
return quick_sort(j+1,r,k-s);
}
int main()
{
int y,t;
scanf(“%d%d”,&y,&t);
for(int p=0;p<y;p++) scanf(“%d”,&q[p]);
cout<< quick_sort(0,y-1,t)<<endl;
return 0;
}