#include <iostream>

using namespace std;

int main()
{
  int N;
  int M;
  int A;
  int b;
  cin >> N >> M;
  while(M>0)
  {
    cin >> A;
    b=b+A;
  }
  if(N-B >= 0)
  cout <<N-B;
 else 
   cout <<"-1";
}