import itertools from copy import deepcopy from functools import cache import sys sys.setrecursionlimit(10 ** 9) import math from collections import Counter, deque input = lambda: sys.stdin.readline().rstrip() mod = 998244353 n, k = map(int, input().split()) a = list(map(int, input().split())) now_dp = [[-math.inf, -math.inf] for _ in range(k + 1)] now_dp[0][1] = 0 # print(dp) for i in range(n): next_dp = deepcopy(now_dp) for j in range(k + 1): if j == 0: continue else: if now_dp[j][0] != -math.inf: next_dp[j][1] = max(now_dp[j][1], now_dp[j][0]) if now_dp[j - 1][1] != -math.inf: next_dp[j][0] = now_dp[j - 1][1] + a[i] now_dp = next_dp # print(next_dp) if max(next_dp[-1]) == -math.inf: print("Impossible") else: print(max(next_dp[-1]))