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

namespace PaizaTest
{
    class Program
    {
        static void Main(string[] args)
        {
            var NM = Console.ReadLine().Split().Select(int.Parse).ToList();
            var spendHomework = 0;
            //for (int i = 0; i < NM[1]; i++)
            //{
            //    spendHomework += int.Parse(Console.ReadLine());
            //}
            spendHomework = Console.ReadLine().Split().Select(int.Parse).Sum();

            var result = -1;
            if(spendHomework <= NM[0])
            {
                result = NM[0] - spendHomework;
            }

            Console.WriteLine(result);

#if DEBUG
            Console.ReadLine();
#endif
        }
    }
}
