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