#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  int x[100500];
  int maxi = 0;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x[i]);
    if (maxi < x[i]) maxi = x[i];
  }
  int ll = n;
  int rr = k;
  int cnt = 0;
  while (ll > rr) {
    ll = ll - 2;
    rr = rr - 1;
    cnt++;
  }
  int pnt1 = 0;
  int pnt2 = cnt * 2 - 1;
  while (pnt1 < pnt2) {
    maxi = max(maxi, x[pnt1] + x[pnt2]);
    pnt1++;
    pnt2--;
  }
  cout << maxi << endl;
}
