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