#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, num;
  cin >> n >> m;
  while (m--) {
    cin >> num;
    n = n - num;
  }
  if (n < 0)
    cout << "-1\n";
  else
    cout << n << endl;
  return 0;
}
