#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
int n, k;
vector<ll> v;
ll const N = 1e6 + 2;
bool solve(ll indx) {
  int c = 0, i = 1;
  for (i = 1; i < n; ++i) {
    if (i == n - 1 && k & 1) break;
    if (v[i] <= indx) c++, i++;
  }
  if (c >= k / 2) return true;
  c = 0, i = 0;
  for (i = 0; i < n; ++i) {
    if (i == n - 1 && k % 2 == 0) break;
    if (v[i] <= indx) c++, i++;
  }
  if (c >= ceil((double)k / 2.0)) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    int q;
    cin >> q;
    v.push_back(q);
  }
  ll start = 0, end = 1e9, mid, res = 0;
  while (end >= start) {
    mid = (start + end) / 2;
    if (solve(mid)) {
      end = mid - 1;
      res = mid;
    } else {
      start = mid + 1;
    }
  }
  cout << res << '\n';
  return 0;
}
