#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <string>
using namespace std;

int main() {
  int n, m, a[10001];
  long long sum = 0;
  int res = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int i = 0; i < m; i++) sum += a[i];
  res = n - sum;
  if (res < 0) res = -1;
  cout << res << endl;
  return 0;
}