using System;
using System.Linq;

public class Test
{
    public static void Main()
    {
        string[] R = Console.ReadLine().Split(" ");

        int N = int.Parse(R[0]);
        int M = int.Parse(R[1]);


        string[] R_ = Console.ReadLine().Split(" ");

        int[] x = new int[R_.Length];

        for (int i = 0; i < R_.Length; i++)
        {
            x[i] = int.Parse(R_[i]);
        }

        int M_sum =x.Sum();

        int result = N - M_sum;

        if (result >= 0)
        {
            System.Console.WriteLine(result);
        }
        else 
        {
            System.Console.WriteLine(-1);
        }
    }
}
