#include <stdio.h>

int main() {
  long n, m, x;

  scanf("%ld %ld", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%ld", &x);
    n = n - x;
  }

  if (n < 0)
    printf("-1\n");
  else
    printf("%ld\n", n);

  return 0;
}