#include <stdio.h>

int main(void)
{
  long int n;
  long int m;
  long int sum=0;
  long int ans;

  scanf("%ld %ld", &n, &m);

  long int a[m];

  for (int i = 0; i < m; i++) {
    scanf("%ld", &a[i]);
  sum += a[i];
  }

  ans = (sum <= n) ? n - sum : -1;

  printf("%ld", ans);

  return 0;
}
