#include<stdio.h>
int main()
{
    int n;
    scanf("%d", &n);

    int m, sum=0, days;
    scanf("%d", &m);

    int arr[m], i;
    for(i=0; i<m; i++)
    {
        scanf("%d", &arr[i]);
    }

    for(i=0; i<m; i++)
    {
     sum = sum + arr[i];
    }

    days = n - sum;

    if(days < n)
        printf("%d\n", days);
    else if(days == n)
        printf("0\n");
    else
        printf("-1\n");

    return 0;
}
