#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, sum_A = 0, ans;
  cin >> N >> M;
  int A[M];
  for (int a = 0; a < M; a++) {
    cin >> A[a];
    sum_A += A[a];
  }
  ans = N - sum_A;
  if (ans < 0) ans = -1;
  cout << ans;
}
