#include <stdio.h>

int main(void) {
  int n, m;
  scanf("%d %d", &n, &m);

  int sum = 0;
  for (int i = 0; i < m; i++) {
    int tmp;
    scanf("%d", &tmp);
    sum += tmp;
  }

  printf("%d\n", sum <= n ? n - sum : -1);

  return 0;
}
