#include <stdio.h>

int main()
{
  int N, M;
  scanf("%d %d", &N, &M);
  
  int i, j, sum = 0, ans;
  for(i=0; i<M; i++){
    scanf("%d", &j);
    sum += j;
  }
  
  if(N - sum < 0){
    ans = -1;
  } else{
    ans = N - sum;
  }
  
  printf("%d", ans);
  
  return 0;
}