#include <stdio.h>

int main (void)
{
 int n,m;
  int a[m];
int  count = 0,i,s;

scanf("%d %d",&n,&m);

for(i = 0; i<m;i++)
{
scanf("%d",&a[i]);
count += a[i];
}

s = n - count;

if(s>=0)
printf("%d",s);
else
printf("-1");

return 0;
}
