#include <bits/stdc++.h>
int main() {
  int n, k, i, j;
  scanf("%d %d", &n, &k);
  int size[n];
  for (i = 0; i < n; i++) scanf("%d", &size[i]);
  int x = 2 * k - n, max = size[n - 1];
  for (i = 0, j = n - 1 - x; j > i; i++, j--) {
    if (size[i] + size[j] > max) max = size[i] + size[j];
  }
  printf("%d", max);
}
