#include<stdio.h>

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