#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include <cmath>

using namespace std;
const long long INF = (long long) (1e18)+1;

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> nums(m);
  for (int i=0; i<m; ++i) {
    cin >> nums[i];
    n-=nums[i];
  }
  if (n>0) {
    cout << n << endl;
  } else {
    cout << -1<< endl;
  }
  return 0;
  
}