#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int INF = 1000 * 1000 * 1000;
const long long LINF = 1LL * INF * INF;
const int MAX = 100010;
const long double PI = acos(-1.);
const double EPS = 1e-6;
const long long MOD = INF + 7;
int n, k;
vector<int> a;
bool ok(int x) {
  bool flag = true;
  int cnt;
  cnt = 0;
  flag = true;
  for (int i = 0; i < n; ++i) {
    if (flag) {
      if (a[i] > x) continue;
      flag = !flag;
      cnt++;
    } else {
      flag = !flag;
      cnt++;
    }
  }
  if (cnt >= k) {
    return true;
  }
  cnt = 0;
  flag = true;
  for (int i = 0; i < n; ++i) {
    if (flag) {
      flag = !flag;
      cnt++;
    } else {
      if (a[i] > x) continue;
      flag = !flag;
      cnt++;
    }
  }
  if (cnt >= k) {
    return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  vector<int> foo = a;
  sort(foo.begin(), foo.end());
  int l = 0;
  int r = n - 1;
  while (abs(r - l) > 1) {
    int m = (r + l) / 2;
    if (ok(foo[m])) {
      r = m;
    } else {
      l = m + 1;
    }
  }
  if (l > r) swap(l, r);
  if (ok(foo[l])) {
    cout << foo[l] << endl;
  } else {
    cout << foo[r] << endl;
  }
  return 0;
}
