#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int n, k, v[MAXN];
void solve() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &v[i]);
  int bg = 1, ed = 1e9;
  while (bg < ed) {
    int mid = (bg == ed - 1) ? bg : (bg + ed) / 2;
    int id = 1, sz = 0;
    for (int i = 1; i <= n; i++) {
      if (id && v[i] <= mid)
        sz++, id = 1 - id;
      else if (!id)
        sz++, id = 1 - id;
    }
    if (sz >= k) {
      ed = mid;
      continue;
    }
    id = 1, sz = 0;
    for (int i = 1; i <= n; i++) {
      if (id)
        sz++, id = 1 - id;
      else if (!id && v[i] <= mid)
        sz++, id = 1 - id;
    }
    if (sz >= k)
      ed = mid;
    else
      bg = mid + 1;
  }
  printf("%d\n", bg);
}
int main() { solve(); }
