
Module Module1

    Sub main()
        Dim user2 As List(Of String) = New List(Of String)(Split(Console.ReadLine(), " "))
        Dim natuyasumiKikan As Long = user2(0)
        Dim syukudai As Long = user2(1)
        Dim result As Long = -1

        Dim user3 As List(Of String) = New List(Of String)(Split(Console.ReadLine(), " "))
        Dim syukudaies As New List(Of Long)(Array.ConvertAll(user3.ToArray, Function(i As String) CLng(i)))

        If syukudaies.Sum <= natuyasumiKikan Then
            result = natuyasumiKikan - syukudaies.Sum

        End If
        Console.WriteLine(result)
    End Sub
  end module