#include<iostream>
using namespace std;

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