#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const int maxn = 2e5 + 10;
const int mod = 1e9 + 7;
long long T, n, k, m;
long long a[maxn];
bool check_odd(long long x) {
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] <= x) {
      cnt++;
      if (i < n) {
        i++, cnt++;
      }
    }
  }
  return cnt >= k;
}
bool check_even(long long x) {
  int cnt = 1;
  for (int i = 2; i <= n; ++i) {
    if (a[i] <= x) {
      cnt++;
      if (i < n) {
        i++, cnt++;
      }
    }
  }
  return cnt >= k;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  long long l = 1, r = 1e9, mid = 0;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check_even(mid) || check_odd(mid)) {
      r = mid - 1;
    } else
      l = mid + 1;
  }
  cout << l << endl;
  return 0;
}
