#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int mod=1e9+7;
signed main(){
    int n,m,a;
    cin>>n>>m;
    int sum=0;
    while(cin>>a)
        sum+=a;
    cout<<max(-1ll,n-sum)<<endl;
}
