#include <bits/stdc++.h>
using namespace std;
int GCD(int a, int b) { return a == 0 ? b : GCD(b % a, a); }
string ntoa(int b) {
  string a = "";
  while (b) {
    a += (b % 10 + '0');
    b /= 10;
  }
  reverse(a.begin(), a.end());
  return a;
}
struct myitem {
  int h;
  int w;
  myitem(int a, int b) {
    h = a;
    w = b;
    if (h > w) {
      int t = h;
      h = w;
      w = t;
    }
  }
};
bool mycompare(myitem a, myitem b) {
  if (a.h == b.h) return a.w < b.w;
  return a.h < b.h;
}
int main() {
  int n, k;
  cin >> n >> k;
  int mxbox = -1;
  vector<int> bellsize;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    bellsize.push_back(a);
  }
  int j = n - 1;
  int left = n;
  while ((k * 2) != left && left) {
    if (bellsize[j] > mxbox) {
      mxbox = bellsize[j];
    }
    k--;
    left--;
    j--;
  }
  int i = 0;
  while (left) {
    if (bellsize[i] + bellsize[j] > mxbox) {
      mxbox = bellsize[i] + bellsize[j];
    }
    i++;
    j--;
    left -= 2;
  }
  cout << mxbox << "\n";
}
