#include<stdio.h>
int main(void){
  int N,M,i,wa=0,day;
  int A[10000];
  scanf("%d",&N);
  scanf("%d",&M);
  for(i=0;i<M;i++){
    scanf("%d",&A[i]);
    wa=wa+A[i];}
  day=N-wa;
  if(day>=0)
    printf("%d",day);
  else
    puts("-1");
return 0;
}