#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;
 
void Main()
{
	int N, M;
    int A[M];
  
  	cin >> N;
    cin >> M;
    
    for(int i = 0; i < M; i++){
    	cin >> A[i];
        N = N - A[i];
    }
    
    if(N < 0){
        N = -1;
    }
        
    printf("%d", N);
	
	
}
 
int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}