#define TASKNAME "sandwiches"
#include <cstdio>
#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <ctime>
#include <cctype>
#include <cstdlib>
#include <cassert>
#include <functional>
#include <iomanip>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <vector>
 
#define EPS (1e-9)
#define INF int(1e9)
#define INFLONG (long long)(1e18)
#define sqr(a) ((a) * (a))
#define all(a) (a).begin(), (a).end()
#define zero(a) memset(a, 0, sizeof(a))
#define abs(a) (((a) < 0) ? -(a) : (a))
#define sz(a) (int)a.size()
#define fst first
#define snd second
#define y1 osrughosduvgarligybakrybrogvba
#define y0 aosfigdalrowgyalsouvgrlvygalri                               
#define mp make_pair
#define pb push_back
#define next dlkjdslfkdj
#define prev dsdflksdfjl
#define hash lkdfjldskfj
#define pi 3.1415926535897932384626433832795
#define eprintf(...) fprintf(stderr, __VA_ARGS__)

#ifdef WIN32
  #define LLD "%I64d"
#else
  #define LLD "%lld"
#endif
               
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef vector <bool> vb;
typedef vector <ll> vll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <int, ll> pil;
typedef vector <pii> vpii;

const int maxn = 2e3;
const int maxk = 1e9;
const int maxdiff = maxn * 2;
const int maxval = 1e7;

int n, k;
int a[maxn + 1];
ll dp[maxdiff + 1][maxn * 2];

int main()
{
  freopen(TASKNAME".in", "r", stdin);
  freopen(TASKNAME".out", "w", stdout);
  while (scanf("%d%d", &n, &k) >= 1)
  {
    assert(1 <= n && n <= maxn);
    assert(1 <= k && k <= maxk);
    for (int i = 1; i <= n; i++)
    {
      scanf("%d", &a[i]);
      assert(1 <= a[i] && a[i] <= maxval);
    }
    if (k < n || k > n * 2)
    {
      printf("Impossible\n");
      continue;
    }
    for (int i = 0; i <= k; i++)
      for (int j = 0; j <= n; j++)
        if (i > 2 * j || i < j)
          dp[i][j] = -INFLONG;
    for (int i = 0; i <= k; i++)
      for (int j = (i + 1) / 2; j <= min(n, i); j++)
      {
        dp[i][j] = 0;
        for (int l = 1; l <= j; l++)
        {
          dp[i][j] = max(dp[i][j], dp[i - l][j - l] + a[l]);
          if (i >= l + 1)
            dp[i][j] = max(dp[i][j], dp[i - l - 1][j - l] + a[l]);
        }
      }
    printf(LLD"\n", dp[k][n]);
    //eprintf("%.5lf\n", double(clock()) / CLOCKS_PER_SEC);
  }
  return 0;
}

