#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1e18 + 5;
template <typename T>
T binpow(T a, T b, T modi) {
  T res = 1;
  while (b) {
    if (b & 1) {
      res = (res * a) % modi;
    }
    b /= 2;
    (a *= a) %= modi;
  }
  return res;
}
template <typename T>
T binpow(T a, T b) {
  T res = 1;
  while (b) {
    if (b & 1) {
      res = (res * a);
    }
    b /= 2;
    a *= a;
  }
  return res;
}
template <typename T>
T add(T a, T b) {
  return (a + b) % mod;
}
template <typename T>
T sub(T a, T b) {
  return add(a, mod - b);
}
template <typename T>
T mul(T a, T b) {
  return (a * b) % mod;
}
long long make_int(string s) {
  long long x = 0;
  reverse(s.begin(), s.end());
  string tmp = s;
  for (long long i = 0; i < s.length(); ++i) {
    x *= 10;
    x += (long long)(tmp.back() - '0');
    tmp.pop_back();
  }
  return x;
}
string make_string(long long s) {
  string x;
  while (s) {
    x.push_back(char(s % 10 + '0'));
    s /= 10;
  }
  reverse(x.begin(), x.end());
  return x;
}
long long dx[] = {0, -1, 0, 1};
long long dy[] = {1, 0, -1, 0};
const long long N = 100;
long long lp[N + 1];
vector<long long> pr;
void ls() {
  for (long long i = 2; i <= N; ++i) {
    if (lp[i] == 0) {
      lp[i] = i;
      pr.push_back(i);
    }
    for (long long j = 0; j < pr.size() && pr[j] <= lp[i] && i * pr[j] <= N;
         j++) {
      lp[i * pr[j]] = pr[j];
    }
  }
}
vector<long long> getfc(long long n) {
  vector<long long> fact;
  while (n != 1) {
    long long x = lp[n];
    fact.push_back(x);
    while (n % x == 0) {
      n /= x;
    }
  }
  return fact;
}
vector<long long> a;
long long k, n;
bool check(long long x, long long par) {
  long long idx = 1;
  if (par) idx = 0;
  long long cnt = 0;
  for (long long i = 0; i < n; ++i) {
    if (idx & 1) {
      if (a[i] <= x) {
        cnt++;
        idx++;
      }
    } else {
      cnt++;
      idx++;
    }
  }
  return cnt >= k;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  a.resize(n);
  for (long long i = 0; i < (n); ++i) {
    cin >> a[i];
  }
  long long lo = 1, hi = 1e9 + 10;
  while (lo < hi) {
    long long mid = (lo + hi) >> 1;
    if (check(mid, 0) || check(mid, 1)) {
      hi = mid;
    } else {
      lo = mid + 1;
    }
  }
  cout << lo;
  return 0;
}
