#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long a[N];
bool cmp(int x, int y) { return x > y; }
long long max(long long x, long long y) { return (x > y) ? x : y; }
int main() {
  long long n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (k >= n)
    cout << a[n] << endl;
  else {
    long long r = (n - k) * 2;
    long long sum, ans = a[n];
    for (int i = 1; i <= r / 2; i++) {
      sum = a[i] + a[r + 1 - i];
      ans = max(ans, sum);
    }
    cout << ans << endl;
  }
  return 0;
}
