#include <bits/stdc++.h>
int main() {
  int vacation, assignment, i, arr[20], sum = 0, ans;
  scanf("%d %d", &vacation, &assignment);
  for (i = 0; i < assignment; i++) {
    scanf("%d", &arr[i]);
    sum = sum + arr[i];
  }
  ans = vacation - sum;
  if (ans < 0) {
    printf("%d", -1);
  } else {
    printf("%d", ans);
  }
  return 0;
}
