import kotlin.math.*
import java.util.*

fun main(args: Array<String>) {
  val (n, _) = readLine()!!.split(' ').map(String::toInt)
  val a = readLine()!!.split(' ').map(String::toInt).sum()
  println(max(n - a, -1))
}
