import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[] as = new int[n]; for (int i = 0 ; i < n ; i++){ as[i] = sc.nextInt(); } List ansList = new ArrayList<>(); for (int i = 0 ; i < n ; i++){ int a = as[i]; if(a % 2 == 1){ int cnt = 1; long sum = a; while(i < n - 1 && as[i+1] % 2 == 1){ sum += as[i+1]; cnt++; i++; } if(cnt >= m){ ansList.add(sum); } } } for (long i : ansList){ System.out.println(i); } } }