import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.stream.Stream; public class No00000143_Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int[] arr = Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); int zan = arr[0] * arr[1] - Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).sum(); System.out.println(zan < 0 ? -1 : zan); } }