#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b) {
  if (a > b)
    return a;
  else
    return b;
}
long long int min(long long int a, long long int b) {
  if (a < b)
    return a;
  else
    return b;
}
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
int XX[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int YY[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long int n, i, j, r, count = 1, k;
  cin >> n >> k;
  long long int arr[n];
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  if (k >= n) {
    cout << arr[n - 1];
    return 0;
  }
  long long int maxi = INT_MIN;
  long long int y = n - k;
  i = y - 1, j = y;
  for (long long int l = n - 1; l > y; l--) {
    maxi = max(maxi, arr[l]);
  }
  while (i >= 0) {
    maxi = max(maxi, arr[i] + arr[j]);
    i--;
    j++;
  }
  cout << maxi;
}
