#include <bits/stdc++.h>
using namespace std;
int n,m,a[12345],b;
int main(){
    cin>>n>>m;
    for(int i=0;i<m;i++){
        cin>>a[i];
        b+=a[i];
    }
    b=n-b;
    if(b<0)cout<<-1<<endl;
    else cout<<b<<endl;
}
