N = gets.chomp.split.map(&:to_i) F = gets.chomp.split.map(&:to_i) if N[0] * N[1] >= F.inject(:+) puts N[0] * N[1] - F.inject(:+) else puts -1 end