#include <stdio.h>

int main ()
{
  int n;
  int m;
  int i;
  
  scanf("%d %d", &n, &m);
  
  int homework[m];
  
  for (i=0; i<m; i++) {
    scanf("%d", &homework[i]);
    n -= homework[i];
  }
  
  if (n >= 0)
    printf("%d",n);
  
  else
    printf("-1");
  
  return 0;
}