#include <stdio.h>
#include <stdlib.h>

int main(void) {
  
  int n, m;
  long sum = 0;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++)
  {
    int a;
    scanf("%d", &a);
    sum += a;
  }
  m = n - sum >= 0 ? n - sum : -1;
  printf("%d\n", m);

  return 0;
}