#include<stdio.h>
int main(void)
{
  long n,m,a;
  int i,res;
  int sum = 0;

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

  for(i=0;i<m;i++){
    scanf("%ld",&a);
    sum+=a;
  }

  res=n-sum;

  if(res>0)
  printf("%d",res);

  else
    printf("%d",-1);

  return 0;
}
