#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int ans = -1;
  if (k >= n) {
    ans = a[n];
    cout << ans << endl;
    return 0;
  }
  for (int i = 1; i <= (n - k); i++)
    ans = max(ans, a[i] + a[2 * (n - k) - i + 1]);
  for (int i = 2 * (n - k) + 1; i <= n; i++) ans = max(ans, a[i]);
  cout << ans << endl;
  return 0;
}
