#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 2e5 + 5;
int a[maxn];
int n, k;
bool check1(int val) {
  int cnt = 1;
  for (int i = 2; i <= n;) {
    if (a[i] <= val) {
      i++;
      cnt++;
      if (i <= n) cnt++, i++;
    } else
      i++;
  }
  return cnt >= k;
}
bool check2(int val) {
  int cnt = 0;
  for (int i = 1; i <= n;) {
    if (a[i] <= val) {
      i++;
      cnt++;
      if (i <= n) cnt++, i++;
    } else
      i++;
  }
  return cnt >= k;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int l = 1, r = 1000000000;
  while (l < r) {
    int mid = (l + r) / 2;
    if (check1(mid) || check2(mid))
      r = mid;
    else
      l = mid + 1;
  }
  cout << l << "\n";
  return 0;
}
