/*
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
*/
#include <bits/stdc++.h>

#define rep(i,n)  for(int i=0; i<(n); i++)
using ll = long long;
using namespace std;

int main()
{
    ll n,m,t,sum=0;
    cin >> n >> m;
    rep(i,m){
        cin >> t;
        sum += t;
    }
    n -= sum;
    if(n >= 0){
        cout << n;
    }else{
        cout << -1;
    }
    return 0;
}
