#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <queue>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <complex>

using ll = long long int;
using namespace std;

int main(){
  ll N, M, tmp;
  vector<ll> A;
  cin >> N >> M;
  for(ll i = 0; i < M; i++){
    cin >> tmp;
    A.push_back(tmp);
  }

  ll ans = N;
  for(ll i = 0; i < M; i++){
    ans -= A[i];
  }

  cerr << "Answer:" << endl;
  cout << max(ans, -1LL) << endl;

  return 0;
}
