#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  long long int a[m], s = 0;
  for (long long int i = 0; i < m; i++) {
    cin >> a[i];
    s = s + a[i];
  }
  long long int r = -1;
  cout << max(r, n - s) << "\n";
  return 0;
}
