#include <stdio.h>

int main(void)
{
  int day,works,i,time;
  int sum=0;
  
  scanf("%d",&day);
  scanf("%d",&works);
  
  for(i=1;i<=works;i++)
  {
    scanf("%d",&time);
    //printf("%d\n",time);
    sum+=time;
  }
  //printf("%d\n",sum);
  if(day-sum>=0)
    printf("%d",day-sum);
  else
    printf("-1");
  
  return 0;
}