#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, k;
int arr[N];
bool check(int x, int cur) {
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (!cur) {
      ans++;
      cur ^= 1;
    } else {
      if (arr[i] <= x) {
        ans++;
        cur ^= 1;
      }
    }
  }
  return ans >= k;
}
int binsearch(int l, int r) {
  while (l < r) {
    int mid = (l + r) / 2;
    if (check(mid, 0) || check(mid, 1))
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
int main() {
  iostream::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  int ans = binsearch(1, 1e9);
  cout << ans;
}
