#include<iostream>
#include <bits/stdc++.h>
#include<math.h>
#include <vector>
using namespace std;
typedef long long ll;

#define pb push_back
#define mp make_pair
#define M 1000000007
int main()
{
	ll n,m,num;
	cin >> n>>m;
	while(m--){
		cin >> num;
		n=n-num;
	}
	if(n<0)
		cout << "-1\n";
	else
		cout << n << endl;
	return 0;
}