#include <stdio.h>
#include <math.h>

int main(int argc, const char * argv[])
{
    int vacationDays, assignments, daysRequired = 0;
    scanf("%d %d", &vacationDays, &assignments);
    
    for(int i = 0; i < assignments; i++)
    {
        int oneAssignment;
        scanf("%d", &oneAssignment);
        daysRequired += oneAssignment;
    }
    
    vacationDays = vacationDays - daysRequired;
    
    if(vacationDays < 0)
    {
       printf("-1 \n");
    }
    else
    {
        printf("%d \n",vacationDays);
    }
    
    return 0;
}
