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