#include<stdio.h>
 
int main(){
  int n,m,i;
  int day=0,aday=0;
  scanf("%d",&n);
  scanf("%d",&m);
  int a[m];
  
  for(i=0;i<m;i++){
    scanf("%d",&a[i]);
    day=day+a[i];
  }
  
  aday=n-day;
  if(aday<0){
    printf("-1");
  }
  
  else{
    printf("%d",aday);
  }
  
  return 0;
}