#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;

int main(){
  // 入力
  long int N, M;
  cin >> N >> M;
  vector<long int> A(M);
  long int sum = 0;
  for (long int i=0; i<M; i++) {
    cin >> A[i];
    sum += A[i];
  } 

  long int result = -1;
  if (N>=sum) {
    result = N - sum;
  }

  cout << result << endl;
  return 0;
}