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