#include <bits/stdc++.h>
using namespace std;
const int MX = 1000000;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
int dp[MX], dp2[MX];
vector<int> v;
int n, k, a[MX];
bool cal(int x) {
  int s1 = 0, s2 = 0, f = 0;
  for (int i = 0; i < n; i++) {
    if (f == 0) {
      s1++, f = 1;
    } else {
      if (a[i] <= x) {
        s2++, f = 0;
      }
    }
  }
  if (s1 >= (k + 1) / 2 && s2 >= (k - ((k + 1) / 2))) return true;
  s1 = s2 = 0, f = 1;
  for (int i = 0; i < n; i++) {
    if (f == 0) {
      s1++, f = 1;
    } else {
      if (a[i] <= x) {
        s2++, f = 0;
      }
    }
  }
  return (s2 >= (k + 1) / 2 && s1 >= (k - ((k + 1) / 2)));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; v.push_back(a[i]), i++) cin >> a[i];
  sort(v.begin(), v.end());
  int lo = 0, hi = n - 1, rs = n - 1;
  while (lo <= hi) {
    int m = (lo + hi) / 2;
    bool r = cal(v[m]);
    if (r)
      rs = m, hi = m - 1;
    else
      lo = m + 1;
  }
  cout << v[rs] << endl;
  return 0;
}
