#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long MAXN = 2e5 + 6;
const long long MAXM = 1e5 + 6;
int a[MAXN], n, k;
bool try1(int maxcost) {
  int br1 = 1, br2 = -1;
  bool flag1 = 0, flag2;
  if (a[1] <= maxcost) {
    flag1 = 1;
    br2 = 1;
    flag2 = 0;
  } else
    flag1 = 0;
  for (int i = 2; i <= n; i++) {
    if (!(a[i] > maxcost && flag1 == 0)) {
      br1++;
      flag1 = !flag1;
    }
    if (br2 == -1) continue;
    if (!(a[i] > maxcost && flag2 == 0)) {
      br2++;
      flag2 = !flag2;
    }
  }
  if (br1 >= k || br2 >= k)
    return 1;
  else
    return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long low = 0, high = INF, mid, ans;
  while (low <= high) {
    mid = (low + high) / 2;
    if (try1(mid)) {
      ans = mid;
      high = mid - 1;
    } else
      low = mid + 1;
  }
  cout << ans << '\n';
  return 0;
}
