//Codes by: Umar Bin Qamar

#include <bits/stdc++.h>
using namespace std;
#define int long long

bool compare(int a,int b){
    return a>b;
}

int32_t main(){

//int count=0;
  int n,m;
  cin>>n>>m;
  //cin>>p;
  int arr[m]={};
  for(int i=0;i<m;i++){
    cin>>arr[i];
  }
  int count=0;
  for(int i=0;i<m;i++){
   count=count +arr[i];
 //   count=count-n;
  }
  if((n-count)>=0){
    cout<<n-count<<endl;
  }
  else{
    cout<<"-1"<<endl;
  }


    return 0;
}

