#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1, INF = 1e9;
int n, k, a[N], d[N][2];
bool check(int x) {
  for (int i = 1; i <= n; ++i) d[i][0] = d[i][1] = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] <= x) d[i][1] = d[i - 1][0] + 1;
    d[i][0] = d[i - 1][1] + 1;
    d[i][1] = max(d[i][1], d[i - 1][1]);
    d[i][0] = max(d[i][0], d[i - 1][0]);
    if (max(d[i][0], d[i][1]) >= k) return 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  int l = 1, r = INF;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  cout << l;
  return 0;
}
