#include <bits/stdc++.h>
using namespace std;
long long a[200010], n, k;
bool check(int mid, bool f) {
  long long cnt = 0;
  for (long long i = 1; i <= n; i++) {
    if (cnt % 2 == !f)
      cnt++;
    else if (a[i] <= mid)
      cnt++;
  }
  if (cnt >= k) return 1;
  return 0;
}
int main() {
  long long mx = 0, mn = INT_MAX;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    mx = max(mx, a[i]);
    mn = min(mn, a[i]);
  }
  long long low = mn, high = mx, mid;
  while (low <= high) {
    mid = (low + high) / 2;
    if (check(mid, 0) || check(mid, 1))
      high = mid - 1;
    else
      low = mid + 1;
  }
  cout << low << "\n";
  return 0;
}
