#include <iostream>
using namespace std;
int main(void){
        int n,m,work=0;
    cin >> n>> m;
    for(int i=0;i<m; i++){
        int a;
        cin >> a;
        work+=a;
    }
    int ans = n-work;
    if(ans<0){
        cout << -1 << endl;
    }else{
        cout << ans << endl;
    }
    
}
