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