#include <bits/stdc++.h>
using namespace std;

const int N = 1e6 + 10, mod = 1e9 + 7;

int n;

int main() {
    // ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int tc = 1; 
    //scanf("%d", &tc);
    while(tc--) {
        int m;
        scanf("%d%d", &n, &m);
        int sum = 0;
        for(int i = 0; i < m; i++) {
            int x; scanf("%d", &x);
            sum += x;
        }
        printf("%d\n", max(-1, n - sum));
    }    
    return 0;
}