#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, k;
  cin >> n >> k;
  long long int arr[n];
  for (long int i = 0; i < n; i++) cin >> arr[i];
  long int p = n;
  long int start = 0;
  vector<long long int> res;
  while (p > 0) {
    if (p < (k * 2)) {
      res.push_back(arr[p - 1]);
      p--;
    } else {
      res.push_back(arr[p - 1] + arr[start]);
      start++;
      p--;
    }
    k--;
  }
  sort(res.begin(), res.end());
  cout << res[res.size() - 1] << endl;
  return 0;
}
