#include<bits/stdc++.h>
#include<algorithm>
#include<vector>
using namespace std;
bool da(int a,int b)
{
return a<b;
}
int main(){
int n,k;
vector<int>a;
// write your code here......
cin>>n>>k;
int i=0;
while(i<n)
{
int x;
cin>>x;
a.push_back(x);
i++;
}
sort(a.begin(),a.end(),da);
cout<<a[k-1];
return 0;
}

京公网安备 11010502036488号