#include <iostream>
using namespace std;

int main() {
    long n, m, ip, sum=0;
    cin>>n>>m;
    for(int i=0; i<m; i++){
        cin>>ip;
        sum += ip;
    }
    n = n-sum;
    if(n>=0)
        cout<<n<<endl;
    else
        cout<<-1<<endl;
}
