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