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

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