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