#include <iostream>
#include <array>
using namespace std;

int main(){
    int n,m,sum=0;
    array<int,1000> working_day;
    cin >> n >> m;
    for(int i=1;i<=m;i++){
        cin >>  working_day[i];
        sum += working_day[i];
    }
    if(n >= sum ){
        cout << n - sum;
    }else{
        cout << -1;
    }
    return 0;
}