#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int main() {
  int n, m, s, a;
  cin >> n >> m;

  s = 0;
  rep(i, m) {
    cin >> a;
    s += a;
  }

  int r = n - s;
  if (r < 0) {
    r = -1;
  }
  cout << r << endl;
}
