#include <stdio.h>
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int a[m], sum = 0;
  for (int i = 0; i < m; i++) {
    scanf("%d", &a[i]);
    sum = sum + a[i];
  }
  int day = n - sum;
  if (day < 0) {
    printf("-1");
  } else {
    printf("%d", day);
  }
  return 0;
}