#include <stdio.h>
#include <math.h>

int main(){

  int N = 0, M = 0;
  scanf("%d %d",&N, &M);

  int i = 0;
  int A[M];
  for( i = 0; i < M; i++ ){
    scanf("%d",&A[i]);
  }

  int sum = 0;
  for( i = 0; i < M; i++ ){
    sum = sum + A[i];
  }

  int res = 0;
  res = N - sum;

  if( res >= 0 ){
    printf("%d",res);
  }
  else{
    printf("-1");
  }

  return 0;
}