#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  long long int arr[n];
  for (long long int i = 0; i < n; i++) cin >> arr[i];
  long long int l = 1, h = *max_element(arr, arr + n), ans;
  while (l <= h) {
    long long int m = (l + h) / 2;
    long long int c1 = 0;
    for (long long int i = 0; i < n - 1 + (k & 1); i++) {
      if (arr[i] <= m) c1++, i++;
    }
    long long int c2 = 0;
    for (long long int i = 1; i < n - (k & 1); i++) {
      if (arr[i] <= m) c2++, i++;
    }
    if (c1 >= k / 2 + (k & 1) || c2 >= k / 2)
      ans = m, h = m - 1;
    else
      l = m + 1;
  }
  cout << ans;
  return 0;
}
