#include <stdio.h>
int main (void){
  struct cell *mklist, *p;
  int n,m,i,a,mix;
  scanf("%d%d",&n,&m);
  for(i=0,mix=0;i<m;i++){
    scanf("%d",&a);
    mix += a;
  }
  n-=mix;
  if(n<0)printf("-1");
  else printf("%d",n);
  return 0;
}
