#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  int A[M];
  int SUM = 0;
  int i = 0;
  while (i != M) {
    cin >> A[i];
    SUM += A[i];
    i++;
  }
  if (N > SUM)
    cout << N - SUM << endl;
  else
    cout << -1 << endl;
  return 0;
}
