#include<stdio.h>
int main(){
  long int n,m,a[1000],shukudai_day=0;
  scanf("%ld %ld",&n,&m);
  for(int i=0;i<m;i++){
    scanf("%ld",&a[i]);
    shukudai_day=shukudai_day+a[i];
  }
  if(n<shukudai_day)
    printf("-1\n");
  else
    printf("%ld\n",n-shukudai_day);
}