#include <iostream>
using namespace std;

int main()
{
  int N, M, input, sum = 0;
  cin >> N >> M;
  for(int i=0;i<M;i++){
    cin >> input;
    sum += input;
  }
  if(input>N){
    cout << -1 << endl;
  }else{
    cout << N - sum << endl;
  }
  return 0;
}