#include<stdio.h>

int main(){
  long int ans=0,N,M,A[10000],sum=0;
  scanf("%ld",&N);
  scanf("%ld",&M);
  scanf("%ld",A,10000);
  for(int a=0;a<=M-1;a++){
    sum+=A[a];
  };
  ans=N-sum;
  if(ans<0)ans=-1;
  printf("&ld",ans);
};
