#include <bits/stdc++.h>
using namespace std;
vector<long long> v(2e5 + 5);
int n;
int k;
bool check(int x, int cur) {
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (!cur) {
      ans++;
      cur ^= 1;
    } else {
      if (v[i] <= x) {
        ans++;
        cur ^= 1;
      }
    }
  }
  return ans >= k;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
  }
  int lo = 1, hi = 1e9;
  while (lo < hi) {
    int mid = (hi + lo) / 2;
    if (check(mid, 0) || check(mid, 1))
      hi = mid;
    else
      lo = mid + 1;
  }
  cout << lo << endl;
  return 0;
}
