#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int a, b, sum = 0;
  cin >> a >> b;
  for (int i = 1; i <= b; i++) {
    int g;
    cin >> g;
    sum += g;
  }
  cout << (a - sum < 0 ? -1 : a - sum);
  return 0;
}
