#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.14159265358979323846264338;
const long long mod = 1000000007;
long long int pow(long long int x, unsigned long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int invmod(long long int a, long long int m) { return pow(a, m - 2); }
const long long int maxn = 2e5 + 5;
vector<long long int> a(maxn);
long long int check(long long int num, long long int n, long long int k) {
  long long int size = 0;
  for (long long int i = 0; i < n; i++) {
    if (size % 2 == 0 && a[i] <= num) {
      size++;
    } else if (size % 2 != 0) {
      size++;
    }
  }
  if (size >= k) return 1;
  size = 0;
  for (long long int i = 0; i < n; i++) {
    if (size % 2 != 0 && a[i] <= num) {
      size++;
    } else if (size % 2 == 0) {
      size++;
    }
  }
  if (size >= k) return 1;
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int lo = 1, hi = 1e9;
  while (lo < hi) {
    long long int mid = (lo + hi) / 2;
    if (check(mid, n, k)) {
      hi = mid;
    } else {
      lo = mid + 1;
    }
  }
  cout << lo << endl;
}
