using System;
using System.Linq;
using System.Collections.Generic;

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var nm = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
        var (n, m) = (nm[0], nm[1]);
        var seqA = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

        var d = Math.Max(-1, n - seqA.Sum());
        
        Console.WriteLine(d);
    }
}
