#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int& v : a) cin >> v;
  auto check = [&](int x) -> bool {
    int cur = 0;
    for (int i = 0; i < n && cur < k; i++) {
      if (cur & 1) {
        cur++;
      } else {
        if (a[i] <= x) cur++;
      }
    }
    if (cur == k) return 1;
    cur = 0;
    for (int i = 0; i < n && cur < k; i++) {
      if (cur & 1) {
        if (a[i] <= x) cur++;
      } else {
        cur++;
      }
    }
    return cur == k;
  };
  int lo = 1, hi = 1e9;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    if (check(mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  cout << lo << "\n";
}
