#include <stdio.h>

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