#include <iostream>

#define MAX(a, b) (a > b ? a : b)
#define MIN(a, b) (a < b ? a : b)

constexpr auto NMAX = (int)2e5 + 20;
constexpr auto INF = 2000000000;
using namespace std;

typedef unsigned long long ull;

int n, m;
int a;

int main()
{
	cin >> n >> m;
	while (m--) 
	{
		cin >> a;
		n -= a;
	}
	cout << (n >= 0 ? n : -1) << '\n';
	return 0;
}