#include <stdio.h>
#define MIN(x,y) (((x) > (y)) ? (y) : (x))
#define ABS(x) ((x) >= 0 ? (x) : (-(x)))

// int m[10000];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a;
    scanf("%d", &a);
    n -= a;
  }
  printf("%d", n < 0 ? -1 : n);
  return 0;
}