#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long n, k;
long long a[N];
bool check(long long x, long long cur) {
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    if (!cur) {
      ans++;
      cur ^= 1;
    } else {
      if (a[i] <= x) {
        ans++;
        cur ^= 1;
      }
    }
  }
  return ans >= k;
}
long long binsearch(long long lo, long long hi) {
  while (lo < hi) {
    long long mid = (lo + hi) / 2;
    if (check(mid, 0) || check(mid, 1))
      hi = mid;
    else
      lo = mid + 1;
  }
  return hi;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long ans = binsearch(1, 1e9);
  cout << ans;
  return 0;
}
