#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int a[MAXN];
int n, k;
bool check(int x) {
  int cnt;
  cnt = 0;
  for (int i = 0; i < n; i++) {
    if (cnt % 2 == 1) {
      if (a[i] <= x) cnt++;
    } else
      cnt++;
  }
  if (cnt >= k) return true;
  cnt = 0;
  for (int i = 0; i < n; i++) {
    if (cnt % 2 == 0) {
      if (a[i] <= x) cnt++;
    } else
      cnt++;
  }
  if (cnt >= k) return true;
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int maxs = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    maxs = max(a[i], maxs);
  }
  int l, r, mid;
  l = 0;
  r = maxs;
  while (l <= r) {
    mid = (l + r) / 2;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  cout << l << '\n';
  return 0;
}
