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