""" 偶奇さえ等しければいける気がしない? """ import sys from sys import stdin N,M = map(int,stdin.readline().split()) A = list(map(int,stdin.readline().split())) Asum = sum(A) if M % 2 == 0 and Asum % 2 == 1: print (-1) sys.exit() assert False