#include "stdio.h"
#define N 10000
int main(){
  int a[N] = {}, b,  c, worktime = 0;
  scanf("%d %d", &b, &c);
  for (size_t i = 0; i < c; i++) {
    scanf("%d", &a[i]);
    worktime += a[i];
  }
  if((b - worktime) >= 0)  printf("%d", b - worktime);
  else printf("-1");
}
