#include<iostream>
#include<math.h>
#include<stdlib.h>
#include<string>
#include<limits.h>
#include<utility>
#include<vector>
#include<tuple>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(A) A.begin(),A.end()

int main() {
	int n, m;
	cin >> n >> m;
	rep(i, m) {
		int a;
		cin >> a;
		n -= a;
	}
	if (n >= 0) {
		cout << n << endl;
		return 0;
	}
	cout << -1 << endl;
}
