#include <iostream>
#include <vector>
using namespace std;
int main()
{
	int N;
	int M;
	cin >> N >> M;
	vector<int> A(N);
	int day = 0;
	int ans = 0;
	for(int i = 0;i<M;i++){
		std::cin >> A[i];
		day += A[i];
	}
	
	int N_day = 0;
	
	if(N-day>=0){
		N_day = N;
		ans = N_day - day;
	    std::cout << ans <<  std::endl;
	}else{
		std::cout << "-1" <<  std::endl;
	}
}