object Main extends App{
  import scala.io.StdIn._
  val Array(n,m)=readLine().split(" ").map(_.toInt)
  val a=readLine().split(" ").map(_.toInt)
  var ans=0
  for{i <- a}{ans+=i}
  println(if(ans>n) -1 else n-ans)
}