#include <bits/stdc++.h>
using namespace std;
long long power(long long base, long long pow, long long mo) {
  long long res = 1;
  while (pow) {
    if (pow % 2 != 0) res = (res * base) % mo;
    base = (base * base) % mo;
    pow /= 2;
  }
  return res;
}
long long inv(long long i) { return power(i, 1000000007 - 2, 1000000007); }
std::string str = "All Good Till Here";
long long i, j, x, n, k;
long long a[200005];
long long check2(long long mid) {
  vector<long long> even, odd;
  long long j = 0;
  for (long long i = 0; i < n; i++) {
    if (j % 2 == 1 && a[i] <= mid) {
      even.push_back(a[i]);
      j++;
    } else if (j % 2 == 0) {
      odd.push_back(a[i]);
      j++;
    }
  }
  return odd.size() + even.size();
}
long long check(long long mid) {
  vector<long long> even, odd;
  long long j = 0;
  for (long long i = 0; i < n; i++) {
    if (j % 2 == 0 && a[i] <= mid) {
      odd.push_back(a[i]);
      j++;
    } else if (j % 2 == 1) {
      even.push_back(a[i]);
      j++;
    }
  }
  return odd.size() + even.size();
}
void solve() {
  long long k;
  cin >> n >> k;
  for (long long c1 = 0; c1 < n; c1++) cin >> a[c1];
  ;
  long long l = 1, r = 1e9, mid;
  while (l < r) {
    mid = l + ((r - l) / 2);
    if (check(mid) >= k || check2(mid) >= k)
      r = mid;
    else
      l = mid + 1;
  }
  cout << l << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long tt;
  tt = 1;
  while (tt--) {
    solve();
  }
  return 0;
}
