#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int A;
  int ans;
  for (int i = 0; i < M; i++) {
    cin >> A;
    ans += A;
  }
  int play;
  play = ans - N;
  if (play >= 0) {
    cout << play << endl;
  } else {
    cout << "-1" << endl;
  }
  return 0;
}
