import scala.io.StdIn

object Main extends App {
  val Array(n,m) = StdIn.readLine.split(" ").map(_.toInt)
  val aSum = StdIn.readLine.split(" ").map(_.toInt).sum
  val res = n - aSum
  if (res >= 0) println(res) else println("-1")
}