#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9;
int arr[300005];
bool check(int mid, int n, int k) {
  int i, tot = 0;
  for (i = 1; i <= n; i++) {
    if (arr[i] <= mid) {
      tot++;
      if (i < n) {
        i++;
        tot++;
      }
    }
  }
  if (tot >= k) return true;
  tot = 1;
  for (i = 2; i <= n; i++) {
    if (arr[i] <= mid) {
      tot++;
      if (i < n) {
        i++;
        tot++;
      }
    }
  }
  if (tot >= k) return true;
  return false;
}
int bin(int n, int k) {
  int lo = 0;
  int hi = 1e9;
  while (hi - lo > 2) {
    int mid = (lo + hi) / 2;
    if (check(mid, n, k)) {
      hi = mid;
    } else {
      lo = mid + 1;
    }
  }
  while (check(hi - 1, n, k)) hi--;
  return hi;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int a, b, c, i, j, k, n, m, t, cs = 1;
  cin >> n >> k;
  for (i = 1; i <= n; i++) cin >> arr[i];
  cout << bin(n, k) << endl;
  return 0;
}
