#include<iostream>
#include<stdio.h>
#include<string>
#include<cmath>
#include<math.h>
#include<vector>
#include<algorithm>
#include<map>
#pragma warning(disable: 4996)
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;


int main() {
	
	ll N, M;
	
	cin >> N >> M;

	vector<int> A(M);

	ll cnt = 0;

	rep(i, M) {
		cin >> A[i];
		cnt += A[i];
	}

	if (N - cnt <= 0) {
		cout << "-1" << endl;
	}
	else if (N - cnt > 0) {
		cout << N - cnt << endl;
	}

	return 0;
}