#include <bits/stdc++.h>
using namespace std;
using lli = long long;
using lld = long double;
using ulli = unsigned long long int;
using pll = pair<lli, lli>;
using ttt = pair<lli, pll>;
using vttt = vector<ttt>;
using vll = vector<pll>;
using vl = vector<lli>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using cd = complex<lld>;
const double PI = acos(-1);
int arr[200010], n, k, trr[200010];
bool check(int ind, int len, int exis = 1) {
  for (int i = ind; i < n; i++) {
    if (trr[i]) {
      len += 2;
      i++;
      if (i < n)
        exis = 1;
      else
        exis = 0;
    }
  }
  len += exis;
  if (len >= k) return 1;
  return 0;
}
bool check(int val) {
  for (int i = 0; i < n; i++) {
    if (arr[i] <= val)
      trr[i] = 1;
    else
      trr[i] = 0;
  }
  return check(1, 0) || check(0, -1);
}
int tejas_919(int kkkk) {
  lli m, q, u, v, temp = 0, ans = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> arr[i];
  int l = 0, r = 1000000007;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  cout << r << '\n';
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(10);
  int t = 1;
  for (int i = 0; i < t; i++) {
    tejas_919(i + 1);
  }
  {};
}
