import java.util.Scanner

import scala.io.StdIn._

object Main extends App {

  val Array(n,m) = readLine().split(" ").map(_.toInt)
  val A = readLine().split(" ").map(_.toInt)

  def solve() = {
    Math.max(n-A.sum, -1)
  }


  println(solve())

}

