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