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

#define N 1000000
#define M 10000

void main(){
  long int a[M], n, m, play_days;
  scanf("%ld %ld",&n, &m);
  for(int i=0; i<m; i++)
    scanf("%ld ",&a[i]);
  
  play_days = n;
  for(int i=0; i<m; i++)
    play_days -= a[i]; 
  
  if(play_days<0)
    printf("-1");
  else
    printf("%ld", play_days);
}