#include <bits/stdc++.h>
using namespace std;
const int nax = 2e5 + 200;
int a[nax], n, k;
bool solve(int x, int f) {
  int sz = 0;
  for (int i = 0; i < (int)n; ++i) {
    if (f) {
      ++sz;
      f ^= 1;
    } else {
      if (a[i] <= x) {
        ++sz;
        f ^= 1;
      }
    }
  }
  return sz >= k;
}
int binary(int l, int r) {
  while (l < r) {
    int mid = l + (r - l) / 2;
    bool f = solve(mid, 0), f1 = solve(mid, 1);
    if (f || f1) {
      r = mid;
    } else {
      l = mid + 1;
    }
  }
  return l;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << setprecision(20) << fixed;
  cin >> n >> k;
  int l = 1, r = 1e9;
  for (int i = 0; i < (int)n; ++i) {
    cin >> a[i];
  }
  int ans = binary(l, r);
  cout << ans << '\n';
}
