#include <bits/stdc++.h>
#include <iostream>
using namespace std ;
typedef long long ll ;
int main()
{
	ll m , n , a ;
	cin >> n >> m ;
	for(ll i = 0 ; i < m ; i++ )
	{
		cin >> a ;
		n -= a ;
	}
	if(a < 0)
		cout << "-1" << endl ;
	else
		cout << n << endl ;
	return 0 ;
} 