fun main(args: Array<String>) {
    var holidays = readLine()!!.split(" ")[0].toLong()
    val homework = readLine()!!.split(" ").map { it.toLong() }.sum()
    println(if (holidays >= homework) holidays - homework else -1)
}