#include <stdio.h>

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