import java.util.Scanner
object Main extends App {
  val sc = new Scanner(System.in)
  val n, m = sc.nextInt
  val daysList =  scala.io.StdIn.readLine().split(' ').map(_.toInt)

  val totalWorkDays = daysList.sum

  val freeDays = n - totalWorkDays
  val answer = if(freeDays < 0) -1 else freeDays

  println(freeDays)
}
