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