#include<bits/stdc++.h>
using namespace std;
#define ll long long int

ll N,M;

int main(){
	cin>>N>>M;

	for(int i=0;i<M;i++){
		ll a;
		cin>>a;
		N -= a;
	}
	if(N>=0)
		cout<<N<<endl;
	else
		cout<<-1<<endl;

}