#include <bits/stdc++.h>
using namespace std;
int Set(int mask, int pos) { return mask = mask | (1 << pos); }
bool check(int mask, int pos) { return (bool)(mask & (1 << pos)); }
int arr[200005], n, k;
int mark[200005];
int check(int start) {
  int lim = (start == 0) ? ((k + 1) >> 1) : (k >> 1);
  int low = 1, high = 1e9, mid, ans = 2147483647;
  while (low <= high) {
    mid = (low + high + 1) >> 1;
    int prev = -1, cnt = 0;
    for (int i = start; i < n; i++) {
      if (arr[i] <= mid) {
        if (start == 0 && (k % 2 == 0) && i == n - 1) continue;
        if (start == 1 && (k & 1) && i == n - 1) continue;
        if (prev == -1) {
          prev = i;
          cnt++;
        } else {
          if (prev != i - 1) {
            cnt++;
            prev = i;
          }
        }
      }
    }
    if (cnt >= lim) {
      ans = mid;
      high = mid - 1;
    } else {
      low = mid + 1;
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int ans = check(0);
  ans = min(ans, check(1));
  cout << ans << endl;
  return 0;
}
