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