#include <bits/stdc++.h>
#define rep(i,a) for(int i=0;i<a;i++)
using namespace std;
using ll = long long;
int main(void){
    int n,m;
    cin>>n>>m;
    int a;
    rep(i,m){
        cin>>a;
        n-=a;
    }
    if(n>=0)
    cout<<n<<endl;
    else cout<<-1<<endl;
}
