#include <bits/stdc++.h>
int main(void) {
  int i;
  int n;
  int m;
  int a[10000];
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &a[i]);
    n -= a[i];
  }
  if (n < -1) n = -1;
  printf("%d", n);
}
