#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(n) n.begin(),n.end()

int main() {
  int n,m;
  cin >> n >> m;
  vector<int>a(m);
  int sum = 0;
  rep(i,m){
    cin >> a[i];
    sum += a[i];
  }
  cout << (n - sum>=0?n - sum:-1) << endl;
}
