#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int Scan() {
  int res = 0, ch, flag = 0;
  if ((ch = getchar()) == '-')
    flag = 1;
  else if (ch >= '0' && ch <= '9')
    res = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') res = res * 10 + ch - '0';
  return flag ? -res : res;
}
int s[100000 + 10];
int main() {
  int n, k;
  scanf("%d%d", &(n), &(k));
  int ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &(s[i]));
    ans = max(ans, s[i]);
  }
  if (n <= k) {
    printf("%d\n", ans);
    return 0;
  }
  int p1 = n - k;
  int p2 = n - k - 1;
  for (int i = p2; i >= 0; i--) {
    ans = max(ans, s[i] + s[p1]);
    p1++;
  }
  printf("%d\n", ans);
  return 0;
}
