#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
long long n, k;
long long a[200010];
long long isOK(long long m) {
  vector<long long> num1, num2;
  if (k % 2 == 0) {
    num1.push_back(-10);
    num2.push_back(-10);
    for (long long i = 0; i < n; i++) {
      if (a[i] <= m) {
        if (i != 0 && num1.back() + 1 != i) {
          num1.push_back(i);
        }
        if (i != n - 1 && num2.back() + 1 != i) {
          num2.push_back(i);
        }
      }
    }
    return num1.size() - 1 >= k / 2 || num2.size() - 1 >= k / 2;
  } else {
    num1.push_back(-10);
    num2.push_back(-10);
    for (long long i = 0; i < n; i++) {
      if (a[i] <= m) {
        if (num1.back() + 1 != i) {
          num1.push_back(i);
        }
        if (0 < i && i < n - 1 && num2.back() + 1 != i) {
          num2.push_back(i);
        }
      }
    }
    return num1.size() - 1 >= (k + 1) / 2 || num2.size() - 1 >= k / 2;
  }
}
signed main() {
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long l = 0, r = INT_MAX;
  while (r - l > 1) {
    long long mid = (r + l) / 2;
    if (isOK(mid)) {
      r = mid;
    } else {
      l = mid;
    }
  }
  cout << r << endl;
  return 0;
}
