#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 9;
const long long N = 500500;
vector<int> a(N);
int n, k;
bool fun(int ans) {
  int index = 1, index2 = 1, cnt = 0, cnt2 = 0;
  for (int i = 1; i <= n; i++) {
    if ((index & 1) && a[i] <= ans) {
      index++;
      cnt++;
    } else if (index % 2 == 0) {
      index++;
      cnt++;
    }
    if (index == k + 1) break;
  }
  for (int i = 1; i <= n; i++) {
    if (index2 & 1) {
      index2++;
      cnt2++;
    } else if (index2 % 2 == 0 && a[i] <= ans) {
      index2++;
      cnt2++;
    }
    if (index2 == k + 1) break;
  }
  if (cnt == k || cnt2 == k)
    return true;
  else
    return false;
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(10);
  cout << fixed;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int left = 1, right = 1e9;
  while (left <= right) {
    int mid = (left + right) / 2;
    if (fun(mid)) {
      right = mid - 1;
    } else
      left = mid + 1;
  }
  cout << left << '\n';
  return 0;
}
