#include <iostream>

using namespace std;

int n, m, a;
long long sum;

int main()
{
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a;
    sum += a;
  }
  int dif = n - sum;
  cout << max (-1, dif);
  return 0;
}
