#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, sum = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a;
    sum += a;
  }
  if (sum <= n) {
    cout << (n - sum) << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
