Module Module1

    Sub Main()

        Dim tmp As String() = Split(Console.ReadLine(), " ")
        Dim N As Integer = CInt(tmp(0)) ' 日数
        Dim M As Integer = CInt(tmp(1)) ' 宿題数
        Dim tmp2 As String() = Split(Console.ReadLine(), " ")

        Dim wd = 0
        For i As Integer = 0 To M - 1
            wd += CInt(tmp2(i))
        Next

        If N >= wd Then
            Console.WriteLine(N - wd)
        Else
            Console.WriteLine(-1)
        End If

        Console.ReadLine()

    End Sub

End Module
