fun readInts() = readLine()!!.split(' ').map { it.toInt() }

fun main() {
    val (holidays, _) = readInts()
    val work = readInts().sum()
    if (work > holidays) {
        println(-1)
    } else {
        println(holidays - work)
    }
}