#include <bits/stdc++.h>
using namespace std;
const int maxn = 111111;
int A[maxn];
using namespace std;
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) != EOF) {
    for (int i = 0; i < n; i++) scanf("%d", &A[i]);
    int m = n - k;
    int ans = 0;
    for (int i = 0; i < m; i++) {
      ans = max(ans, A[i] + A[2 * m - 1 - i]);
    }
    ans = max(ans, A[n - 1]);
    printf("%d\n", ans);
  }
  return 0;
}
