#include <bits/stdc++.h>
using namespace std;
int s[100001], b[100001];
int main() {
  int n, k, i, j, ans;
  scanf("%d%d", &n, &k);
  for (i = n - 1; i >= 0; i--) scanf("%d", &s[i]);
  for (i = 0; i < k; i++) b[i] = s[i];
  j = k - 1;
  for (i = k; i < n; i++) {
    b[j] += s[i];
    j--;
  }
  ans = 0;
  for (i = 0; i < k; i++) ans = max(ans, b[i]);
  cout << ans << endl;
  return 0;
}
