#include <bits/stdc++.h>
using namespace std;
bool even(int x, int k, vector<int> a) {
  int l = 0, f = 1, i = 0;
  while (i < a.size()) {
    if (f == 1) {
      i++;
      f = 0;
      l++;
    } else if (f == 0 && a[i] <= x) {
      i++;
      f = 1;
      l++;
    } else
      i++;
  }
  if (l >= k)
    return true;
  else
    return false;
}
bool odd(int x, int k, vector<int> a) {
  int l = 0, f = 1, i = 0;
  while (i < a.size()) {
    if (f == 0) {
      i++;
      f = 1;
      l++;
    } else if (f == 1 && a[i] <= x) {
      i++;
      f = 0;
      l++;
    } else
      i++;
  }
  if (l >= k)
    return true;
  else
    return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k, s, e, i, m;
  cin >> n >> k;
  vector<int> a(n);
  vector<int> v(n);
  for (i = 0; i < n; i++) {
    cin >> a[i];
    v[i] = a[i];
  }
  sort(v.begin(), v.end());
  s = 0;
  e = n - 1;
  while (s < e) {
    m = s + (e - s) / 2;
    if (even(v[m], k, a) || odd(v[m], k, a)) {
      e = m;
    } else {
      s = m + 1;
    }
  }
  cout << v[s] << endl;
  return 0;
}
