#include <stdio.h>

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

    return 0;
}