import Foundation
let main: () = {
    let (N, _) = *listOfInt()
    let A = listOfInt()
    let ans = max(N - A.sum(), -1)
    print(ans)
}()
@inlinable func next() -> String { readLine()! }
@inlinable func nextInt() -> Int { Int(next())! }
@inlinable func nextDouble() -> Double { Double(next())! }
@inlinable func listOfString() -> [String] { next().split(separator: " ").map(String.init) }
@inlinable func listOfInt() -> [Int] { listOfString().map { Int($0)! } }
prefix operator *
prefix func * <T> (a: [T]) -> (T, T) { (a[0], a[1]) }
extension Array where Element == Int {
    @inlinable func sum() -> Element { self.reduce(0, +) }
}
