// Homework

func main() {
    let nm = readLine()!.split(separator: " ").map{Int($0)!}
    let a = readLine()!.split(separator: " ").map{Int($0)!}

    let workingdays = a.reduce(0, +)
    let rest = nm[0] - workingdays
    if rest < 0 {
        print(-1)
    } else { 
        print(rest)
    }
}

main()