#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M,A;
  cin >> N >> M;

  A = 0;
  
  for (int i = 0; i < M; i++) {
    int t;
    cin >> t;
    
    A += t;
  }
  
  if (N - A >= 0) cout << N - A << endl;
  
  else cout << -1 << endl;

    

}
