#include <bits/stdc++.h>
using namespace std;

int main() {
  double n, m, x, sum = 0;
  cin >> n >> m;

  for (int i = 0; i < m; i++) {
    cin >> x;
    n -= x;
  }

  if (n < 0)
    cout << "-1" << endl;
  else
    cout << n << endl;
}