#include <vector>
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <bits/stdc++.h>


using namespace std;


int main(void){
  
  int N,M,ans=0;
  vector<int> A;

  
  
  cin >> N >> M;

  for(int i = 0; i < M ;i++){
    int tmp;
    cin >> tmp;
    A.push_back(tmp);
  }

  ans = N;

  for(int i = 0; i < M ;i++){
    ans -= A.at(i);
  }

  if(ans <0){
    ans =-1;
  }

  cout << ans << endl;
  

  return 0;
}


