#include <stdio.h>

int main()
{
    int n,m;
    scanf ("%d %d", &n, &m);
    
    int sum = 0;
    for (int i = 0; i < m; i++) {
        int a;
        scanf("%d", &a);
        sum += a;
    }
    
    int ret = -1;
    if (sum <= n) ret = n - sum;
    printf("%d\n", ret);
}
