#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int a[maxn];
int n, k;
int ok(int x, int cul) {
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (!cul) {
      ans++;
      cul ^= 1;
    } else {
      if (a[i] <= x) {
        ans++;
        cul ^= 1;
      }
    }
  }
  return ans >= k;
}
int cul(int l, int r) {
  int ans = 0;
  while (l <= r) {
    int m = (l + r) / 2;
    if (ok(m, 1) || ok(m, 0)) {
      ans = m;
      r = m - 1;
    } else
      l = m + 1;
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int ans = cul(1, (int)1e9);
  printf("%d\n", ans);
}
