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