#include <stdio.h>
int main(void)
{
    int N, M, sum_days = 0;
    scanf("%i %i", &N, &M);
    for (int i = 0; i < M; i++)
    {
        int days;
        scanf("%i", &days);
        sum_days += days;
    }

    printf("%i\n", N >= sum_days ? N - sum_days : -1);
    return 0;
}