import java.util.Scanner; public class yukicoder_143 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String n = scanner.nextLine(); String m = scanner.nextLine(); String[] array = n.split(" "); int sum = Integer.parseInt(array[0]) * Integer.parseInt(array[1]); String[] array_fam = m.split(" "); int sum_fam = 0; for (int i = 0; i < array_fam.length; i++) { sum_fam += Integer.parseInt(array_fam[i]); } if (sum >= sum_fam) { System.out.println(sum - sum_fam); } else { System.out.println(-1); } } }