#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int hoge;
    cin >> hoge;
    n -= hoge;
  }
  if (n < 0) n = -1;
  cout << n;
}
