#include <stdio.h>

int main(void) {
  int N,M,i,x,days,HW=0;
  
  scanf("%d",&N);
  scanf("%d",&M);
  
  for(i=0;i<M;i++){
    scanf("%d",&x);
    HW += x;
  }
  
  days = N - HW;
  
  if(days>=0)
    return days;
  
  else
    return -1;
}
  