#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 2e5;
long long Power(int x, int y) {
  long long ans = 1;
  for (long long t = x; y; y >>= 1) {
    if (y & 1) ans = (ans * t);
    t = (t * t);
  }
  return ans;
}
int Rev(int x) { return Power(x, mod - 2); }
int n, k;
int a[2 * N + 5];
int c[5];
bool check(int res) {
  int d1 = 0;
  if (k & 1)
    for (int i = 1; i <= n; i++) {
      if (a[i] <= res) d1++, i++;
    }
  else
    for (int i = 1; i <= n - 1; i++) {
      if (a[i] <= res) d1++, i++;
    }
  if (d1 >= ceil(1.0 * k / 2)) return 1;
  int d2 = 0;
  if (k & 1)
    for (int i = 2; i <= n - 1; i++) {
      if (a[i] <= res) d2++, i++;
    }
  else
    for (int i = 2; i <= n; i++) {
      if (a[i] <= res) d2++, i++;
    }
  if (d2 >= k / 2) return 1;
  return 0;
}
void solve() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int l = 1, r = 1e9;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  cout << l;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) solve();
}
