#include <iostream>
#include <string>
#include <algorithm>
#include <stdlib.h>
#include <math.h>
#define ll long long 

using namespace std;
int res = 0;



int main(){
    int n, m; cin >> n >> m;
    int a[m];
    for(int i=0; i<m; i++) cin >> a[i];
    int sum = 0;
    for(int i=0; i<m; i++){
        sum = sum + a[i];
    }
    if(n - sum > 0) cout << n - sum << endl;
    else cout << -1 << endl;
}