import scala.annotation.tailrec
object Main extends App {

  import scala.io.StdIn._

  val Array(n, m) = readLine.trim.split(' ').map(_.toInt)
  val sum = readLine.trim.split(' ').map(_.toInt).sum
  println(
    math.max(n - sum, -1)
  )

}