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