#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1e18

using namespace std;

int main(void){
  ll n, m;
  cin >> n >> m;
  
  ll sum = 0;
  for (int i = 0; i < m; i++){
    ll a;
    cin >> a;
    
    sum += a;
  }


  cout << max(-1LL, n - sum) << endl;
  

  return 0;
}
