#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int N = 0, M = 0, c = 0, a = 0, ans;
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> a;
    c += a;
  }
  if (N <= c)
    cout << "-1" << endl;
  else {
    ans = N - c;
  }
  cout << ans << endl;
  return 0;
}
