#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,m, sum = 0;
    cin >> n >> m;
    std::vector<int> a(n);
    for(int i = 0; i < m; i++){
        cin >> a[i];
        sum += a[i];
    }
    if(n >= sum) cout << n - sum;
    else cout << "-1";
    
    
}
