#include<bits/stdc++.h>
using namespace std;
using p=pair<int,int>;
#define int long long
#define rep(i,N) for(int i=0;i<N;i++)

signed main(){
 int N,M;
 cin>>N>>M;
 vector<int> A(M);
 rep(i,M)cin>>A[i];
 int Asum=0;
 rep(i,M)Asum+=A[i];
 if(N-Asum>=0)cout<<N-Asum<<endl;
 else cout<<-1<<endl;
 }