#include<stdio.h>

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