#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int a,b,c[10005],d;
d=0;
cin>>a>>b;
for(int i=1;i<=b;i++)
{
	cin>>c[i];
	d=d+c[i];
}
if(a>d)
{
	cout<<a-d;
}
else
{
	cout<<"-1";
}
return 0;

}