#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  std::cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long int n, k;
std::vector<long long int> v;
long long int ans = 1000000007;
long long int check(long long int mid) {
  long long int tmp = 0;
  long long int count = 0;
  for (long long int i = 0; i < n; i++) {
    if (count == k) {
      break;
    }
    if (count % 2 == 0) {
      count++;
    } else {
      if (v[i] <= mid) {
        count++;
        tmp = max(tmp, v[i]);
      }
    }
  }
  if (count == k) {
    ans = min(ans, mid);
    return 1;
  }
  tmp = 0;
  count = 0;
  for (long long int i = 0; i < n; i++) {
    if (count == k) {
      break;
    }
    if (count % 2 == 1) {
      count++;
    } else {
      if (v[i] <= mid) {
        count++;
        tmp = max(tmp, v[i]);
      }
    }
  }
  if (count == k) {
    ans = min(ans, mid);
    return 1;
  }
  return 0;
}
long long int solve() {
  cin >> n >> k;
  for (long long int i = 0; i < n; i++) {
    long long int a;
    cin >> a;
    v.push_back(a);
  }
  long long int low = 1, high = 1000000000;
  while (low + 1 < high) {
    long long int mid = (low + high) / 2;
    if (check(mid) == 1) {
      high = mid - 1;
    } else {
      low = mid;
    }
  }
  check(low);
  check(high);
  cout << ans;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
