#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long a[200005];
bool check(long long x, long long odd) {
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    if (!odd) {
      ans++;
      odd = (odd ^ 1);
    } else {
      if (a[i] <= x) {
        ans++;
        odd = (odd ^ 1);
      }
    }
  }
  return ans >= k;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long l = 1, h = 1e9;
  long long mid;
  while (l < h) {
    mid = (l + (h - l) / 2);
    if (check(mid, 0) || check(mid, 1))
      h = mid;
    else
      l = mid + 1;
  }
  cout << l << "\n";
  return 0;
}
