#include <bits/stdc++.h>
using namespace std;
template <class T>
void re(T& x) {
  cin >> x;
}
template <class T1, class T2>
void re(pair<T1, T2>& x) {
  re(x.first);
  re(x.second);
}
template <class T>
void re(vector<T>& x) {
  for (long i = 0; i < x.size(); i++) {
    re(x[i]);
  }
}
template <class T>
void re(deque<T>& x) {
  for (long i = 0; i < x.size(); i++) {
    re(x[i]);
  }
}
template <class T1, class T2>
pair<T1, T2> mp(T1& x, T2& z) {
  return make_pair(x, z);
}
template <class T>
T cross(complex<T> x, complex<T> z) {
  return (conj(x) * z).imag();
}
template <class T>
T dot(complex<T> x, complex<T> z) {
  return (conj(x) * z).real();
}
template <class T>
void out(vector<T> v, long x = 0) {
  for (long i = x; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
template <class T>
void reset(vector<T>& x, T& z) {
  x.clear();
  x.resize(z);
}
long long n, k;
vector<long long> v;
bool solve(long x) {
  long ret = 0;
  bool ok = false;
  for (long i = 0; i < n; i++) {
    if (v[i] <= x) {
      ret++;
      if (ret == k / 2 && i < n - 1) {
        ok = true;
      }
      i++;
    }
  }
  if (k % 2 == 0) {
    if (ok) {
      return true;
    }
  }
  if (k % 2 == 1 && ret >= (k + 1) / 2) {
    return true;
  }
  ret = 0;
  ok = false;
  for (long i = 1; i < n; i++) {
    if (v[i] <= x) {
      ret++;
      if (ret == k / 2 && i < n - 1) {
        ok = true;
      }
      i++;
    }
  }
  if (k % 2 == 1) {
    if (ok) {
      return true;
    }
    return false;
  }
  if (ret >= k / 2) {
    return true;
  }
  return false;
}
long long bin(long long l, long long r) {
  long long mid, ans = r;
  while (l <= r) {
    mid = (l + r) / 2;
    if (solve(mid)) {
      r = mid - 1;
      ans = min(ans, mid);
    } else {
      l = mid + 1;
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k;
  v.resize(n);
  re(v);
  cout << bin(1, 1e9) << endl;
  return 0;
}
