#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int b = n - m;
  int max1 = 0;
  if (b <= 0)
    printf("%d", a[n - 1]);
  else {
    int c = 2 * m - n;
    if (!c) {
      for (int i = 0; i < n / 2; i++) max1 = max(a[n - 1 - i] + a[i], max1);
      printf("%d", max1);
    } else {
      max1 = a[n - 1];
      for (int i = 0; i < b; i++) max1 = max(a[i] + a[2 * b - i - 1], max1);
      printf("%d", max1);
    }
  }
  return 0;
}
