#include <iostream>

using namespace std;
 
    
    
int main(){
  int n,m;
  cin>>n>>m;
  int day[m];
  
  for (int i = 0; i < m; i++)
  {
    cin>>day[i];
  }
  
  int sum=0;

  for (int i = 0; i < m; i++)
  {
    sum=sum+day[i];
  }

  n=n-sum;
  if (n<0)
  {
    cout<<-1<<endl;
  }
  
  else
  {
    cout<<n<<endl;
  }
  
    return 0;
}