s=gets.chomp.split(" ") old=gets.chomp.split(" ") surplus=s[0]*s[1]-old.sum if surplus<0 puts -1 else puts surplus end