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