import java.util.Scanner

object Main {
  def main(args:Array[String]) = {
      
  val sc = new java.util.Scanner(System.in)
  val n:Long = sc.nextLong
  val m:Long = sc.nextLong
  val days = List.fill(m.toInt)(sc.nextLong)
  
  val allHomeworkDays: Long = days.sum
  val calcRemnantDayes: Long = n - allHomeworkDays
  
  println( if(calcRemnantDayes < 0) "-1" else calcRemnantDayes.toString )
  }
  

    
}