first_input = [int(x) for x in input().split(" ")] eat_bean_numbers = [int(x) for x in input().split(" ")] total_beans = first_input[0] * first_input[1] total_eat_number = sum(eat_bean_numbers) diff = total_beans - total_eat_number res = -1 if diff < 0 else diff print(res)