
#include<bits/stdc++.h>
using namespace std;

int main (){
	
	int n, m, sum, x, a;
	sum =0;

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