#include <bits/stdc++.h>
#pragma GCC optimize("fast-math")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long INF = 1e9 + 228;
const long long INFLL = 1e18;
const long long MOD = 1e9 + 7;
const long double eps = 1e-4;
const long double eps2 = 1e-9;
const long long MOD2 = 998244353;
const long long dosz = 5e5;
const long long SZ = (1 << 18);
const long double PI = atan2l(0, -1);
void fast_io() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}
void solve() {
  long long n, k;
  cin >> n >> k;
  vector<long long> nums(n);
  for (long long i = 0; i < n; i++) {
    cin >> nums[i];
  }
  long long l = 0, r = 1e9;
  long long ans = 0;
  while (l <= r) {
    long long mid = (l + r) / 2;
    vector<long long> dp(n, 0);
    dp[0] = (nums[0] <= mid);
    dp[1] = max((long long)(nums[1] <= mid), dp[0]);
    for (long long i = 2; i < n; i++) {
      dp[i] = max(dp[i - 2] + (nums[i] <= mid), dp[i - 1]);
    }
    vector<long long> dp1(n, 0);
    dp1[0] = 0;
    dp1[1] = (nums[1] <= mid);
    for (long long i = 2; i < n; i++) {
      dp1[i] = max(dp1[i - 2] + (nums[i] <= mid), dp1[i - 1]);
    }
    if (k & 1) {
      if (dp[n - 1] >= (k + 1) / 2 || dp1[n - 2] >= (k) / 2) {
        r = mid - 1;
        ans = mid;
      } else {
        l = mid + 1;
      }
    } else {
      if (dp[n - 2] >= k / 2 || dp1[n - 1] >= k / 2) {
        r = mid - 1;
        ans = mid;
      } else {
        l = mid + 1;
      }
    }
  }
  cout << ans << endl;
}
signed main() {
  fast_io();
  srand(time(NULL));
  cout << fixed << setprecision(12);
  long long q = 1;
  while (q--) solve();
}
