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): # print(now_dp) for j in range(k, 0, -1): now_dp[j][1] = max(now_dp[j][1], now_dp[j][0]) now_dp[j][0] = now_dp[j - 1][1] + a[i] if max(now_dp[-1]) == -math.inf: print("Impossible") else: print(max(now_dp[-1]))