#include<bits/stdc++.h>
const int maxn=100000|1;
inline const void read(int &a)
{
a=0;
char c=getchar();
while(c<'0'||c>'9')c=getchar();
while(c>='0'&&c<='9')
{
a=(a<<1)+(a<<3)+c-'0';
c=getchar();
}
}
inline const void write(int a)
{
if(a>9)write(a/10);
putchar(a%10+'0');
}
int n,k,a[maxn],ans[maxn<<4],d=0;
int main()
{
read(n);read(k);
for(int i=1;i<=n;i++)read(a[i]);
for(int i=1;i<=n;i++)
{
int p[maxn],l=0,r;
for(int j=i;j<=n;j++)
{
p[++l]=a[j];r=l;
while(r>1&&p[r]<p[r-1]){std::swap(p[r],p[r-1]);--r;}
if(!(j-i&1))ans[++d]=p[l/2+1];
}
}
std::sort(ans+1,ans+1+d);
write(ans[k]);
return 0;
}