#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100 * 1000 + 10;
int a[MAX_N];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (k >= n) {
    cout << a[n - 1];
    return 0;
  }
  int ans = a[n - 1];
  int t = 2 * k - n;
  k -= t;
  n -= t;
  for (int i = 0, j = n - 1; i < n && j >= 0 && i <= j; i++, j--) {
    ans = max(ans, a[i] + a[j]);
  }
  cout << ans << endl;
  return 0;
}
