#include <bits/stdc++.h>

using namespace std;

int main ()
{
  int n, m;
  cin >> n >> m;
  int a[m + 9];
  for (int i = 0; i < m; i++)
  {
    cin >> a[i];
    n -= a[i];
  }
  
  if (n >= 0)
    cout << n;
  else
    cout << "-1";
  
  return 0;
}