object Main extends App {
  val input = scala.io.StdIn.readLine().split(' ').map(_.toInt)
  val N = input(0)
  val M = input(1)
  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)
}
